Class: BooleanFieldType
- Inherits:
-
Cortex::FieldType
- Object
- Cortex::FieldType
- BooleanFieldType
- Defined in:
- app/models/boolean_field_type.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
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
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'app/models/boolean_field_type.rb', line 2 def value @value end |
Instance Method Details
#data=(data_hash) ⇒ Object
8 9 10 |
# File 'app/models/boolean_field_type.rb', line 8 def data=(data_hash) @value = data_hash['value'] end |
#elasticsearch_mapping ⇒ Object
4 5 6 |
# File 'app/models/boolean_field_type.rb', line 4 def elasticsearch_mapping { name: mapping_field_name, type: :boolean } end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
12 13 14 15 16 |
# File 'app/models/boolean_field_type.rb', line 12 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['value'] json end |