Class: ActiveMethod::Executor
- Inherits:
-
Object
- Object
- ActiveMethod::Executor
- Defined in:
- lib/active_method/executor.rb
Instance Attribute Summary collapse
-
#method_class ⇒ Object
readonly
Returns the value of attribute method_class.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Instance Method Summary collapse
- #call(*args, &block) ⇒ Object
-
#initialize(klass, owner) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(klass, owner) ⇒ Executor
Returns a new instance of Executor.
6 7 8 9 |
# File 'lib/active_method/executor.rb', line 6 def initialize(klass, owner) @method_class = klass @owner = owner end |
Instance Attribute Details
#method_class ⇒ Object (readonly)
Returns the value of attribute method_class.
4 5 6 |
# File 'lib/active_method/executor.rb', line 4 def method_class @method_class end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
4 5 6 |
# File 'lib/active_method/executor.rb', line 4 def owner @owner end |
Instance Method Details
#call(*args, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/active_method/executor.rb', line 11 def call(*args, &block) method = method_class.new(*args) method.__set_owner(owner) method.call(&block) end |