Skip to content
instance method · added in Ruby 3.3

Refinement#target

() -> ::Module?
target → class_or_module

Return the class or module refined by the receiver.

Example
module M
  refine String do
  end
end

M.refinements[0].target # => String

Ruby version changes

  1. 3.3
See also #import_methods also in 4.1 · 3.4 · 3.3