Module: Rulz::InstanceMethods
- Defined in:
- lib/rulz.rb
Instance Method Summary collapse
- #apply!(action, *args) ⇒ Object
- #apply_rules! ⇒ Object
- #condition_false?(name, *args) ⇒ Boolean
- #condition_true?(name, *args) ⇒ Boolean
Instance Method Details
#apply!(action, *args) ⇒ Object
30 31 32 |
# File 'lib/rulz.rb', line 30 def apply!(action, *args) Rulz::Evaluator::Action.new(self, action, *args).evaluate end |
#apply_rules! ⇒ Object
34 35 36 |
# File 'lib/rulz.rb', line 34 def apply_rules! Rulz::Rule.rules(self.class).each { |rule| rule.apply!(self) } end |
#condition_false?(name, *args) ⇒ Boolean
26 27 28 |
# File 'lib/rulz.rb', line 26 def condition_false?(name, *args) not condition_true?(name, *args) end |
#condition_true?(name, *args) ⇒ Boolean
22 23 24 |
# File 'lib/rulz.rb', line 22 def condition_true?(name, *args) Rulz::Evaluator::Condition.new(self, name, *args).evaluate end |