Class: BooleanFieldType
- Inherits:
-
FieldType
- Object
- 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
- #field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
- #mapping ⇒ 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
4 5 6 |
# File 'app/models/boolean_field_type.rb', line 4 def data=(data_hash) @value = data_hash.deep_symbolize_keys[:value] end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'app/models/boolean_field_type.rb', line 8 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['value'] json end |
#mapping ⇒ Object
14 15 16 |
# File 'app/models/boolean_field_type.rb', line 14 def mapping { name: mapping_field_name, type: :string, analyzer: :snowball } end |