module DR::CoreExt::UnboundMethod
Public Instance Methods
call(*args,&b)
click to toggle source
# File lib/dr/ruby_ext/core_modules.rb, line 233 def call(*args,&b) to_proc.call(*args,&b) end
to_proc()
click to toggle source
this should be in the stdlib… Note: this is similar to Symbol#to_proc which works like this:
foo=:foo.to_proc; foo.call(obj,*args) #=> obj.method(:foo).call(*args) => :length.to_proc.call("foo") #=> 3
# File lib/dr/ruby_ext/core_modules.rb, line 228 def to_proc return lambda do |obj,*args,&b| bind(obj).call(*args,&b) end end