Class: Arelastic::Mappings::Type
- Inherits:
-
Nodes::Node
- Object
- Nodes::Node
- Arelastic::Mappings::Type
- Defined in:
- lib/arelastic/mappings/type.rb
Class Attribute Summary collapse
-
.type ⇒ Object
readonly
Returns the value of attribute type.
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(field, options = {}) ⇒ Type
constructor
A new instance of 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, options = {}) ⇒ Type
Returns a new instance of Type.
12 13 14 15 |
# File 'lib/arelastic/mappings/type.rb', line 12 def initialize(field, = {}) @field = field @options = end |
Class Attribute Details
.type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/arelastic/mappings/type.rb', line 5 def type @type end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
11 12 13 |
# File 'lib/arelastic/mappings/type.rb', line 11 def field @field end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/arelastic/mappings/type.rb', line 11 def @options end |
Class Method Details
.for_type(type) ⇒ Object
6 7 8 |
# File 'lib/arelastic/mappings/type.rb', line 6 def for_type(type) @type = type end |
Instance Method Details
#as_elastic ⇒ Object
17 18 19 20 21 |
# File 'lib/arelastic/mappings/type.rb', line 17 def as_elastic params = {'type' => self.class.type}.update() { field => params } end |