Class: RulesProcessor::Operations::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rules_processor/operations/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#conditionObject

Returns the value of attribute condition.



5
6
7
# File 'lib/rules_processor/operations/base.rb', line 5

def condition
  @condition
end

#condition_valueObject

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

#fieldObject

Returns the value of attribute field.



5
6
7
# File 'lib/rules_processor/operations/base.rb', line 5

def field
  @field
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/rules_processor/operations/base.rb', line 5

def options
  @options
end

#record_classObject

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_valueObject

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

#recordsObject

Returns the value of attribute records.



5
6
7
# File 'lib/rules_processor/operations/base.rb', line 5

def records
  @records
end

#valueObject

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

#performObject



23
24
25
# File 'lib/rules_processor/operations/base.rb', line 23

def perform
  fail NotImplementedError
end