class ActionHandler::Call

Attributes

args[R]
method_name[R]

Public Class Methods

new(method_name, args = []) click to toggle source
# File lib/action_handler/call.rb, line 8
def initialize(method_name, args = [])
  raise ArgumentError, 'args must be an array' unless args.is_a?(Array)

  @method_name = method_name.to_sym
  @args = args.freeze
end

Public Instance Methods

==(other) click to toggle source

overrides

# File lib/action_handler/call.rb, line 20
def ==(other)
  other.is_a?(ActionHandler::Call) &&
    method_name == other.method_name &&
    args == other.args
end
call_with(receiver) click to toggle source
# File lib/action_handler/call.rb, line 15
def call_with(receiver)
  receiver.send(method_name, *args)
end
hash() click to toggle source

overrides

# File lib/action_handler/call.rb, line 27
def hash
  [method_name, args].hash
end