Class: Kiba::Extend::Utils::Lookup::FieldEmptiness

Inherits:
Object
  • Object
show all
Defined in:
lib/kiba/extend/utils/lookup/field_emptiness.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#resultObject (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