Class: FloatFieldType
- Inherits:
-
Cortex::FieldType
- Object
- Cortex::FieldType
- FloatFieldType
- Defined in:
- app/models/float_field_type.rb
Instance Attribute Summary collapse
-
#float ⇒ Object
Returns the value of attribute float.
Instance Method Summary collapse
- #data=(data_hash) ⇒ Object
- #elasticsearch_mapping ⇒ Object
- #field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
Instance Attribute Details
#float ⇒ Object
Returns the value of attribute float.
2 3 4 |
# File 'app/models/float_field_type.rb', line 2 def float @float end |
Instance Method Details
#data=(data_hash) ⇒ Object
13 14 15 |
# File 'app/models/float_field_type.rb', line 13 def data=(data_hash) @float = data_hash['float'] end |
#elasticsearch_mapping ⇒ Object
9 10 11 |
# File 'app/models/float_field_type.rb', line 9 def elasticsearch_mapping { name: mapping_field_name, type: :float } end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'app/models/float_field_type.rb', line 17 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['float'] json end |