class MethodCall

Attributes

args[RW]
block[RW]
method[RW]

Public Class Methods

new(method, args, &block) click to toggle source
# File lib/method_call.rb, line 2
def initialize(method, args, &block)
  self.method = method
  self.args = args
  self.block = block
end

Public Instance Methods

inspect() click to toggle source
# File lib/method_call.rb, line 12
def inspect
  ":#{method}[#{args_inspect}]#{block_inspect}"
end
to_proc() click to toggle source
# File lib/method_call.rb, line 8
def to_proc
  Proc.new { |obj| obj.send(method, *args, &block) }
end

Private Instance Methods

args_inspect() click to toggle source
# File lib/method_call.rb, line 22
def args_inspect
  args.map(&:inspect).join(', ')
end
block_inspect() click to toggle source
# File lib/method_call.rb, line 18
def block_inspect
  block ? '{...}' : nil
end