Class: MethodCallbacks::Executor
- Inherits:
-
Object
- Object
- MethodCallbacks::Executor
- Defined in:
- lib/method_callbacks/executor.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(method, type, object) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(method, type, object) ⇒ Executor
Returns a new instance of Executor.
5 6 7 8 9 |
# File 'lib/method_callbacks/executor.rb', line 5 def initialize(method, type, object) @method = method @type = type @object = object end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/method_callbacks/executor.rb', line 3 def method @method end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
3 4 5 |
# File 'lib/method_callbacks/executor.rb', line 3 def object @object end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/method_callbacks/executor.rb', line 3 def type @type end |
Instance Method Details
#execute(&block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/method_callbacks/executor.rb', line 11 def execute(&block) case type when :proxy execute_proxy_callbacks(&block) when :around execute_around_callbacks(&block) else execute_callbacks end end |