Class: Arelastic::Mappings::MultiField
- Inherits:
-
Type
- Object
- Nodes::Node
- Type
- Arelastic::Mappings::MultiField
- Defined in:
- lib/arelastic/mappings/types/multi_field.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#field_mappings ⇒ Object
readonly
Returns the value of attribute field_mappings.
Attributes inherited from Type
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(field, field_mappings) ⇒ MultiField
constructor
A new instance of MultiField.
Methods inherited from Type
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(field, field_mappings) ⇒ MultiField
Returns a new instance of MultiField.
5 6 7 8 |
# File 'lib/arelastic/mappings/types/multi_field.rb', line 5 def initialize(field, field_mappings) @field = field @field_mappings = field_mappings end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/arelastic/mappings/types/multi_field.rb', line 4 def field @field end |
#field_mappings ⇒ Object (readonly)
Returns the value of attribute field_mappings.
4 5 6 |
# File 'lib/arelastic/mappings/types/multi_field.rb', line 4 def field_mappings @field_mappings end |
Instance Method Details
#as_elastic ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/arelastic/mappings/types/multi_field.rb', line 10 def as_elastic { field => { 'type' => 'multi_field', 'fields' => field_mappings } } end |