Class: Etna::Clients::Magma::RowBase

Inherits:
Object
  • Object
show all
Defined in:
lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb

Instance Method Summary collapse

Instance Method Details

#nil_or_empty?(value) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb', line 65

def nil_or_empty?(value)
  value.nil? || value.empty?
end

#stripped_value(attribute_value) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb', line 56

def stripped_value(attribute_value)
  attribute_value = attribute_value&.strip

  if attribute_value && @workflow.json_values && attribute_value != @workflow.hole_value
    attribute_value = JSON.parse(attribute_value)
  end
  attribute_value
end