Class: DecisionAgent::Dmn::Rule
- Inherits:
-
Object
- Object
- DecisionAgent::Dmn::Rule
- Defined in:
- lib/decision_agent/dmn/model.rb
Overview
Decision table rule (row)
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input_entries ⇒ Object
readonly
Returns the value of attribute input_entries.
-
#output_entries ⇒ Object
readonly
Returns the value of attribute output_entries.
Instance Method Summary collapse
- #add_input_entry(entry) ⇒ Object
- #add_output_entry(entry) ⇒ Object
- #freeze ⇒ Object
-
#initialize(id:, description: nil) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(id:, description: nil) ⇒ Rule
169 170 171 172 173 174 |
# File 'lib/decision_agent/dmn/model.rb', line 169 def initialize(id:, description: nil) @id = id.to_s @description = description&.to_s @input_entries = [] @output_entries = [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
167 168 169 |
# File 'lib/decision_agent/dmn/model.rb', line 167 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
167 168 169 |
# File 'lib/decision_agent/dmn/model.rb', line 167 def id @id end |
#input_entries ⇒ Object (readonly)
Returns the value of attribute input_entries.
167 168 169 |
# File 'lib/decision_agent/dmn/model.rb', line 167 def input_entries @input_entries end |
#output_entries ⇒ Object (readonly)
Returns the value of attribute output_entries.
167 168 169 |
# File 'lib/decision_agent/dmn/model.rb', line 167 def output_entries @output_entries end |
Instance Method Details
#add_input_entry(entry) ⇒ Object
176 177 178 |
# File 'lib/decision_agent/dmn/model.rb', line 176 def add_input_entry(entry) @input_entries << entry.to_s end |
#add_output_entry(entry) ⇒ Object
180 181 182 |
# File 'lib/decision_agent/dmn/model.rb', line 180 def add_output_entry(entry) @output_entries << entry end |
#freeze ⇒ Object
184 185 186 187 188 189 190 191 192 |
# File 'lib/decision_agent/dmn/model.rb', line 184 def freeze @id.freeze @description.freeze @input_entries.each(&:freeze) @input_entries.freeze @output_entries.map { |e| e.freeze if e.respond_to?(:freeze) } @output_entries.freeze super end |