Module: Elasticsearch::Model::ClassMethods
- Included in:
- Elasticsearch::Model
- Defined in:
- lib/elasticsearch/model.rb
Instance Method Summary collapse
-
#client ⇒ Object
Get the client common for all models.
-
#client=(client) ⇒ Object
Set the client for all models.
Instance Method Details
#client ⇒ Object
Get the client common for all models
134 135 136 |
# File 'lib/elasticsearch/model.rb', line 134 def client @client ||= Elasticsearch::Client.new end |
#client=(client) ⇒ Object
Note:
You have to set the client before you call Elasticsearch methods on the model, or set it directly on the model; see Elasticsearch::Model::Client::ClassMethods#client
Set the client for all models
148 149 150 |
# File 'lib/elasticsearch/model.rb', line 148 def client=(client) @client = client end |