Class: Wayfarer::Callbacks::ConditionalCallback
- Inherits:
-
Struct
- Object
- Struct
- Wayfarer::Callbacks::ConditionalCallback
- Defined in:
- lib/wayfarer/callbacks.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#job ⇒ Object
Returns the value of attribute job.
Instance Method Summary collapse
Instance Attribute Details
#filters ⇒ Object
Returns the value of attribute filters
8 9 10 |
# File 'lib/wayfarer/callbacks.rb', line 8 def filters @filters end |
#job ⇒ Object
Returns the value of attribute job
8 9 10 |
# File 'lib/wayfarer/callbacks.rb', line 8 def job @job end |
Instance Method Details
#run(method, &block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/wayfarer/callbacks.rb', line 9 def run(method, &block) return if only && !applies?(only) return if except && applies?(except) return job.send(method) if method job.instance_eval(&block) end |