Module: Elasticsearch::Model::Naming::InstanceMethods
- Defined in:
- lib/elasticsearch/model/naming.rb
Instance Method Summary collapse
- #document_type(name = nil) ⇒ Object
-
#document_type=(name) ⇒ Object
Set the document type.
-
#index_name(name = nil, &block) ⇒ Object
Get or set the index name for the model instance.
-
#index_name=(name) ⇒ Object
Set the index name.
Instance Method Details
#document_type(name = nil) ⇒ Object
107 108 109 |
# File 'lib/elasticsearch/model/naming.rb', line 107 def document_type name=nil @document_type = name || @document_type || self.class.document_type end |
#document_type=(name) ⇒ Object
Set the document type
115 116 117 |
# File 'lib/elasticsearch/model/naming.rb', line 115 def document_type=(name) @document_type = name end |
#index_name(name = nil, &block) ⇒ Object
Get or set the index name for the model instance
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/elasticsearch/model/naming.rb', line 83 def index_name name=nil, &block if name || block_given? return (@index_name = name || block) end if @index_name.respond_to?(:call) @index_name.call else @index_name || self.class.index_name end end |
#index_name=(name) ⇒ Object
Set the index name
98 99 100 |
# File 'lib/elasticsearch/model/naming.rb', line 98 def index_name=(name) @index_name = name end |