Module: Bali::Integrator::RuleGroup
- Defined in:
- lib/bali/integrators/rule_group_integrator.rb
Class Method Summary collapse
-
.for(target_class, subtarget) ⇒ Object
attempt to search the rule group, but if not exist, will return nil.
-
.make_plant(rule_group) ⇒ Object
make a rule group a plant, that is, he cannot do everything, unless specified more specifically otherwise by a definite rule.
-
.make_zeus(rule_group) ⇒ Object
make a rule group a zeus, that is, he can do everything, unless specified more specifically otherwise by a definite rule.
Class Method Details
.for(target_class, subtarget) ⇒ Object
attempt to search the rule group, but if not exist, will return nil
9 10 11 12 |
# File 'lib/bali/integrators/rule_group_integrator.rb', line 9 def for(target_class, subtarget) rule_class = Bali::Integrator::RuleClass.for(target_class) rule_class.nil? ? nil : rule_class.rules_for(subtarget) end |
.make_plant(rule_group) ⇒ Object
make a rule group a plant, that is, he cannot do everything, unless specified more specifically otherwise by a definite rule
23 24 25 26 |
# File 'lib/bali/integrators/rule_group_integrator.rb', line 23 def make_plant(rule_group) rule_group.plant = true rule_group.zeus = false end |
.make_zeus(rule_group) ⇒ Object
make a rule group a zeus, that is, he can do everything, unless specified more specifically otherwise by a definite rule
16 17 18 19 |
# File 'lib/bali/integrators/rule_group_integrator.rb', line 16 def make_zeus(rule_group) rule_group.zeus = true rule_group.plant = false end |