Class: RinterceptorInvocation
- Inherits:
-
Object
- Object
- RinterceptorInvocation
- Defined in:
- lib/rinterceptor_invocation.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#method ⇒ Object
Returns the value of attribute method.
-
#object ⇒ Object
Returns the value of attribute object.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(object, method, *args) ⇒ RinterceptorInvocation
constructor
A new instance of RinterceptorInvocation.
- #invoke(*args) ⇒ Object
Constructor Details
#initialize(object, method, *args) ⇒ RinterceptorInvocation
Returns a new instance of RinterceptorInvocation.
3 4 5 6 7 8 |
# File 'lib/rinterceptor_invocation.rb', line 3 def initialize(object, method, *args) @object = object @method = method @args = args @options = {} end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
2 3 4 |
# File 'lib/rinterceptor_invocation.rb', line 2 def args @args end |
#method ⇒ Object
Returns the value of attribute method.
2 3 4 |
# File 'lib/rinterceptor_invocation.rb', line 2 def method @method end |
#object ⇒ Object
Returns the value of attribute object.
2 3 4 |
# File 'lib/rinterceptor_invocation.rb', line 2 def object @object end |
#options ⇒ Object
Returns the value of attribute options.
2 3 4 |
# File 'lib/rinterceptor_invocation.rb', line 2 def @options end |
Instance Method Details
#invoke(*args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/rinterceptor_invocation.rb', line 9 def invoke(*args) unless @options.nil? || @options.empty? @args = @args + [@options] @options = nil end @object.send("old4rinter_#{@method}".to_sym, *(args.empty? ? @args : args)) end |