Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

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.0 · 3.4 · 3.3