Class: Commutator::Options::Proxy::Operation
- Inherits:
-
Object
- Object
- Commutator::Options::Proxy::Operation
- Defined in:
- lib/commutator/options/proxy.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #apply(options, chainable_history = nil) ⇒ Object
-
#initialize(method, args, block) ⇒ Operation
constructor
A new instance of Operation.
Constructor Details
#initialize(method, args, block) ⇒ Operation
Returns a new instance of Operation.
17 18 19 20 21 |
# File 'lib/commutator/options/proxy.rb', line 17 def initialize(method, args, block) @method = method @args = args @block = block end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
15 16 17 |
# File 'lib/commutator/options/proxy.rb', line 15 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
15 16 17 |
# File 'lib/commutator/options/proxy.rb', line 15 def block @block end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
15 16 17 |
# File 'lib/commutator/options/proxy.rb', line 15 def method @method end |
Instance Method Details
#apply(options, chainable_history = nil) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/commutator/options/proxy.rb', line 23 def apply(, chainable_history = nil) .send(method, *args, &block).tap do |result| # if result == self then that was a call to #with_context chainable_history << self if chainable_history && result == end end |