Class: Elasticsearch::Extensions::Documents::Document
- Inherits:
-
Object
- Object
- Elasticsearch::Extensions::Documents::Document
- Defined in:
- lib/elasticsearch/extensions/documents/document.rb
Class Attribute Summary collapse
-
.index_type ⇒ Object
(also: type)
readonly
Returns the value of attribute index_type.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
- #as_hash ⇒ Object
- #id ⇒ Object
-
#initialize(object) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(object) ⇒ Document
Returns a new instance of Document.
7 8 9 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 7 def initialize(object) @object = object end |
Class Attribute Details
.index_type ⇒ Object (readonly) Also known as: type
Returns the value of attribute index_type.
16 17 18 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 16 def index_type @index_type end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
5 6 7 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 5 def object @object end |
Class Method Details
.indexes_as_type(type) ⇒ Object
12 13 14 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 12 def indexes_as_type(type) @index_type = type.to_s end |
Instance Method Details
#as_hash ⇒ Object
24 25 26 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 24 def as_hash raise NotImplementedError, 'A subclass should define this method' end |
#id ⇒ Object
20 21 22 |
# File 'lib/elasticsearch/extensions/documents/document.rb', line 20 def id object.id end |