Class: Onuro::RuleStage
- Inherits:
-
Object
- Object
- Onuro::RuleStage
- Defined in:
- lib/onuro/rule_stage.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rule:, enabled:, order:) ⇒ RuleStage
constructor
A new instance of RuleStage.
Constructor Details
#initialize(rule:, enabled:, order:) ⇒ RuleStage
Returns a new instance of RuleStage.
7 8 9 10 11 |
# File 'lib/onuro/rule_stage.rb', line 7 def initialize(rule:, enabled:, order:) @rule = rule @enabled = enabled @order = order end |
Instance Attribute Details
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/onuro/rule_stage.rb', line 5 def enabled @enabled end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
5 6 7 |
# File 'lib/onuro/rule_stage.rb', line 5 def order @order end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
5 6 7 |
# File 'lib/onuro/rule_stage.rb', line 5 def rule @rule end |
Class Method Details
.default_ruleset_stage_factory(rules) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/onuro/rule_stage.rb', line 13 def self.default_ruleset_stage_factory(rules) ruleset_stage = [] order = 1 rules.each do |rule| ruleset_stage << RuleStage.new(rule: rule, enabled: true, order: order) order += 1 end ruleset_stage end |