Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Method#clone

method.clone → new_method

Returns a clone of this method.

Example
class A
  def foo
    return "bar"
  end
end

m = A.new.method(:foo)
m.call # => "bar"
n = m.clone.call # => "bar"
See also #call #curry #arity #eql? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0