Class: Rooq::ExecutorHooks
- Inherits:
-
Object
- Object
- Rooq::ExecutorHooks
- Defined in:
- lib/rooq/executor.rb
Instance Attribute Summary collapse
-
#after_execute ⇒ Object
readonly
Returns the value of attribute after_execute.
-
#before_execute ⇒ Object
readonly
Returns the value of attribute before_execute.
Instance Method Summary collapse
-
#initialize(before_execute: nil, after_execute: nil) ⇒ ExecutorHooks
constructor
A new instance of ExecutorHooks.
- #with_after_execute(block) ⇒ Object
- #with_before_execute(block) ⇒ Object
Constructor Details
#initialize(before_execute: nil, after_execute: nil) ⇒ ExecutorHooks
Returns a new instance of ExecutorHooks.
51 52 53 54 55 |
# File 'lib/rooq/executor.rb', line 51 def initialize(before_execute: nil, after_execute: nil) @before_execute = before_execute @after_execute = after_execute freeze end |
Instance Attribute Details
#after_execute ⇒ Object (readonly)
Returns the value of attribute after_execute.
49 50 51 |
# File 'lib/rooq/executor.rb', line 49 def after_execute @after_execute end |
#before_execute ⇒ Object (readonly)
Returns the value of attribute before_execute.
49 50 51 |
# File 'lib/rooq/executor.rb', line 49 def before_execute @before_execute end |
Instance Method Details
#with_after_execute(block) ⇒ Object
61 62 63 |
# File 'lib/rooq/executor.rb', line 61 def with_after_execute(block) ExecutorHooks.new(before_execute: @before_execute, after_execute: block) end |
#with_before_execute(block) ⇒ Object
57 58 59 |
# File 'lib/rooq/executor.rb', line 57 def with_before_execute(block) ExecutorHooks.new(before_execute: block, after_execute: @after_execute) end |