Class: CLabs::CaseGen::Rule
Direct Known Subclasses
Instance Attribute Summary collapse
-
#criteria ⇒ Object
readonly
Returns the value of attribute criteria.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(rule_data) ⇒ Rule
constructor
A new instance of Rule.
- #parse_rule ⇒ Object
Constructor Details
#initialize(rule_data) ⇒ Rule
Returns a new instance of Rule.
127 128 129 130 |
# File 'lib/agents/sets.rb', line 127 def initialize(rule_data) @data = rule_data parse_rule end |
Instance Attribute Details
#criteria ⇒ Object (readonly)
Returns the value of attribute criteria.
125 126 127 |
# File 'lib/agents/sets.rb', line 125 def criteria @criteria end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
125 126 127 |
# File 'lib/agents/sets.rb', line 125 def data @data end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
125 126 127 |
# File 'lib/agents/sets.rb', line 125 def description @description end |
Instance Method Details
#parse_rule ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/agents/sets.rb', line 132 def parse_rule data = @data.sub(self.class.regexp, '') criteria_data, *@description = data.split(/\n/) criteria_data.strip! @criteria = Criteria.new(criteria_data) @description = (@description.join("\n") + "\n").outdent.strip end |