Class: Onuro::RuleStage

Inherits:
Object
  • Object
show all
Defined in:
lib/onuro/rule_stage.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#enabledObject (readonly)

Returns the value of attribute enabled.



5
6
7
# File 'lib/onuro/rule_stage.rb', line 5

def enabled
  @enabled
end

#orderObject (readonly)

Returns the value of attribute order.



5
6
7
# File 'lib/onuro/rule_stage.rb', line 5

def order
  @order
end

#ruleObject (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