Class: Ecoportal::API::GraphQL::Base::Page::DataField::Number

Inherits:
DataField
  • Object
show all
Defined in:
lib/ecoportal/api/graphql/base/page/data_field/number.rb

Instance Method Summary collapse

Instance Method Details

#as_inputObject



13
14
15
16
17
# File 'lib/ecoportal/api/graphql/base/page/data_field/number.rb', line 13

def as_input
  return nil unless dirty?

  { number: { id: id, value: value } }
end

#value=(numeric) ⇒ Object

Blank (empty / whitespace CSV cell) → nil, NOT 0.0 — see DataField#numeric_or_nil. Whether a blank should CLEAR the field or be LEFT UNTOUCHED is the caller's policy; this only guarantees a blank never becomes the value 0.0.



9
10
11
# File 'lib/ecoportal/api/graphql/base/page/data_field/number.rb', line 9

def value=(numeric)
  doc['value'] = numeric_or_nil(numeric)
end