Class: BooleanFieldType
- Inherits:
-
FieldType
- Object
- FieldType
- BooleanFieldType
- Defined in:
- app/models/boolean_field_type.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#field_name ⇒ Object
Returns the value of attribute field_name.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#validations ⇒ Object
Returns the value of attribute validations.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #acceptable_validations? ⇒ Boolean
- #field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
- #mapping ⇒ Object
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'app/models/boolean_field_type.rb', line 2 def data @data end |
#field_name ⇒ Object
Returns the value of attribute field_name.
2 3 4 |
# File 'app/models/boolean_field_type.rb', line 2 def field_name @field_name end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'app/models/boolean_field_type.rb', line 3 def end |
#validations ⇒ Object
Returns the value of attribute validations.
3 4 5 |
# File 'app/models/boolean_field_type.rb', line 3 def validations @validations end |
#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
#acceptable_validations? ⇒ Boolean
27 28 29 |
# File 'app/models/boolean_field_type.rb', line 27 def acceptable_validations? true end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'app/models/boolean_field_type.rb', line 17 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['boolean'] json end |
#mapping ⇒ Object
23 24 25 |
# File 'app/models/boolean_field_type.rb', line 23 def mapping { name: mapping_field_name, type: :string, analyzer: :snowball } end |