Module: Rulz::InstanceMethods

Defined in:
lib/rulz.rb

Instance Method Summary collapse

Instance Method Details

#apply!(action, *args) ⇒ Object



29
30
31
# File 'lib/rulz.rb', line 29

def apply!(action, *args)
  Rulz::Evaluator::Action.new(self, action, *args).evaluate
end

#apply_rules!Object



33
34
35
# File 'lib/rulz.rb', line 33

def apply_rules!
  Rulz::Rule.rules(self.class).each { |rule| rule.apply!(self) }
end

#condition_false?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rulz.rb', line 25

def condition_false?(name, *args)
  not condition_true?(name, *args)
end

#condition_true?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rulz.rb', line 21

def condition_true?(name, *args)
  Rulz::Evaluator::Condition.new(self, name, *args).evaluate
end