Class: RubyExt::Callbacks::AbstractCallback
- Inherits:
-
Object
- Object
- RubyExt::Callbacks::AbstractCallback
- Defined in:
- lib/ruby_ext/more/callbacks.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#executor ⇒ Object
Returns the value of attribute executor.
Instance Method Summary collapse
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
8 9 10 |
# File 'lib/ruby_ext/more/callbacks.rb', line 8 def conditions @conditions end |
#executor ⇒ Object
Returns the value of attribute executor.
3 4 5 |
# File 'lib/ruby_ext/more/callbacks.rb', line 3 def executor @executor end |
Instance Method Details
#run?(target, method, data) ⇒ Boolean
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ruby_ext/more/callbacks.rb', line 24 def run? target, method, data if cond = conditions[:if] evaluate_if(cond, target, data) elsif cond = conditions[:unless] !evaluate_if(cond, target, data) elsif cond = conditions[:only] evaluate_only(cond, method, data) elsif cond = conditions[:except] !evaluate_only(cond, method, data) else true end end |