Class: BooleanFieldType

Inherits:
FieldType
  • Object
show all
Defined in:
app/models/boolean_field_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data.



2
3
4
# File 'app/models/boolean_field_type.rb', line 2

def data
  @data
end

#field_nameObject

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

#metadataObject

Returns the value of attribute metadata.



3
4
5
# File 'app/models/boolean_field_type.rb', line 3

def 
  
end

#validationsObject

Returns the value of attribute validations.



3
4
5
# File 'app/models/boolean_field_type.rb', line 3

def validations
  @validations
end

#valueObject

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

Returns:

  • (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, options = {})
  json = {}
  json[mapping_field_name] = field_item.data['boolean']
  json
end

#mappingObject



23
24
25
# File 'app/models/boolean_field_type.rb', line 23

def mapping
  { name: mapping_field_name, type: :string, analyzer: :snowball }
end