Class: Kiba::Extend::Utils::Lookup::FieldEmptiness
- Inherits:
-
Object
- Object
- Kiba::Extend::Utils::Lookup::FieldEmptiness
- Defined in:
- lib/kiba/extend/utils/lookup/field_emptiness.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(field:, row:, mergerow:) ⇒ FieldEmptiness
constructor
A new instance of FieldEmptiness.
Constructor Details
#initialize(field:, row:, mergerow:) ⇒ FieldEmptiness
Returns a new instance of FieldEmptiness.
10 11 12 13 14 15 16 17 |
# File 'lib/kiba/extend/utils/lookup/field_emptiness.rb', line 10 def initialize(field:, row:, mergerow:) h = {"row" => row, "mergerow" => mergerow} fvals = field.split("::") @field = fvals[1].to_sym @row = fvals[0] val = h[@row].fetch(@field, "") @result = (val.nil? || val.empty?) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/kiba/extend/utils/lookup/field_emptiness.rb', line 8 def result @result end |