Class: RulesProcessor::Operations::Base
- Inherits:
-
Object
- Object
- RulesProcessor::Operations::Base
- Defined in:
- lib/rules_processor/operations/base.rb
Direct Known Subclasses
GreaterThan, GreaterThanEqual, Include, Is, IsNot, LessThan, LessThanEqual, NotInclude
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#condition_value ⇒ Object
Returns the value of attribute condition_value.
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
-
#record_class ⇒ Object
Returns the value of attribute record_class.
-
#record_value ⇒ Object
Returns the value of attribute record_value.
-
#records ⇒ Object
Returns the value of attribute records.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
- #perform ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 20 21 |
# File 'lib/rules_processor/operations/base.rb', line 14 def initialize(args = {}) @records = args[:records] @condition = OpenStruct.new(args[:condition]) @record_class = condition.field.split('_', 2)[0].to_sym @field = condition.field.split('_', 2)[1].to_sym @record_value = actual_value @condition_value = nullified_value end |
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def condition @condition end |
#condition_value ⇒ Object
Returns the value of attribute condition_value.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def condition_value @condition_value end |
#field ⇒ Object
Returns the value of attribute field.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def @options end |
#record_class ⇒ Object
Returns the value of attribute record_class.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def record_class @record_class end |
#record_value ⇒ Object
Returns the value of attribute record_value.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def record_value @record_value end |
#records ⇒ Object
Returns the value of attribute records.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def records @records end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/rules_processor/operations/base.rb', line 5 def value @value end |
Instance Method Details
#perform ⇒ Object
23 24 25 |
# File 'lib/rules_processor/operations/base.rb', line 23 def perform fail NotImplementedError end |