--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: Looks up the named method as a receiver in obj, returning a Method object (or raising NameError). The Method object acts as a closure in obj's object instance, so instance variables and the value of self remain available.
- !ruby/struct:SM::Flow::VERB
body: " class Demo\n def initialize(n)\n @iv = n\n end\n def hello()\n "Hello, @iv = #{@iv}"\n end\n end\n\n k = Demo.new(99)\n m = k.method(:hello)\n m.call #=> "Hello, @iv = 99"\n\n l = Demo.new('Fred')\n m = l.method("hello")\n m.call #=> "Hello, @iv = Fred"\n"
full_name: Object#method
is_singleton: false
name: method
params: |
obj.method(sym) => method
visibility: public