Class: MethodMissingRouter::CallInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/method_missing_router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, method_name, *args, &block) ⇒ CallInfo

Returns a new instance of CallInfo.



95
96
97
98
99
100
# File 'lib/method_missing_router.rb', line 95

def initialize(object, method_name, *args, &block)
  @object = object
  @method_name = method_name
  @args = args
  @block = block
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



94
95
96
# File 'lib/method_missing_router.rb', line 94

def args
  @args
end

#blockObject

Returns the value of attribute block.



94
95
96
# File 'lib/method_missing_router.rb', line 94

def block
  @block
end

#method_nameObject

Returns the value of attribute method_name.



94
95
96
# File 'lib/method_missing_router.rb', line 94

def method_name
  @method_name
end

#objectObject

Returns the value of attribute object.



94
95
96
# File 'lib/method_missing_router.rb', line 94

def object
  @object
end

Instance Method Details

#callObject



106
107
108
# File 'lib/method_missing_router.rb', line 106

def call
  @object.send(method_name, *args, &block)
end

#prepend_argument(new_arg) ⇒ Object



102
103
104
# File 'lib/method_missing_router.rb', line 102

def prepend_argument(new_arg)
  @args.unshift(new_arg)
end