Class: TextFieldType
- Inherits:
-
FieldType
- Object
- FieldType
- TextFieldType
- Defined in:
- app/models/text_field_type.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
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
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'app/models/text_field_type.rb', line 2 def text @text end |
Instance Method Details
#data=(data_hash) ⇒ Object
9 10 11 |
# File 'app/models/text_field_type.rb', line 9 def data=(data_hash) @text = data_hash.deep_symbolize_keys[:text] end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
13 14 15 16 17 |
# File 'app/models/text_field_type.rb', line 13 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['text'] json end |
#mapping ⇒ Object
19 20 21 |
# File 'app/models/text_field_type.rb', line 19 def mapping {name: mapping_field_name, type: :string, analyzer: :snowball} end |