Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method · added in Ruby 3.3

Refinement#target

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 #refined_class #import_methods also in 4.1 · 4.0 · 3.4