Class: Symbol
Instance Method Summary collapse
-
#call(receiver, *args) ⇒ Object
Calls self on the given receiver.
-
#to_proc ⇒ Object
Returns a proc that calls self on the proc’s parameter.
Instance Method Details
#call(receiver, *args) ⇒ Object
Calls self on the given receiver
21 22 23 |
# File 'lib/ruby/symbol.rb', line 21 def call(receiver, *args) receiver.__send__(self, *args) end |
#to_proc ⇒ Object
Returns a proc that calls self on the proc’s parameter
10 11 12 |
# File 'lib/ruby/symbol.rb', line 10 def to_proc lambda{|*args| args.head.__send__(self, *args.tail) } end |