Class: ActiveRecord::Journal::Journable::Rule
- Inherits:
-
Object
- Object
- ActiveRecord::Journal::Journable::Rule
- Extended by:
- Forwardable
- Defined in:
- lib/active_record/journal/journable/rule.rb
Instance Attribute Summary collapse
-
#journable ⇒ Object
readonly
Returns the value of attribute journable.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #conditions_met?(rec) ⇒ Boolean
-
#initialize(journable, options) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(journable, options) ⇒ Rule
Returns a new instance of Rule.
19 20 21 22 |
# File 'lib/active_record/journal/journable/rule.rb', line 19 def initialize(journable, ) @journable = journable @options = end |
Instance Attribute Details
#journable ⇒ Object (readonly)
Returns the value of attribute journable.
17 18 19 |
# File 'lib/active_record/journal/journable/rule.rb', line 17 def journable @journable end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/active_record/journal/journable/rule.rb', line 17 def @options end |
Instance Method Details
#conditions_met?(rec) ⇒ Boolean
24 25 26 27 28 29 30 |
# File 'lib/active_record/journal/journable/rule.rb', line 24 def conditions_met?(rec) return true unless self.if || self.unless assert_value = self.if ? true : false condition = self.if || self.unless assert_condition(condition, rec, assert_value) end |