Class: Elasticsearch::Persistence::Repository::Class
- Inherits:
-
Object
- Object
- Elasticsearch::Persistence::Repository::Class
- Includes:
- Model::Indexing::ClassMethods, Client::ClassMethods, Find, Naming, Search, Serialize, Store
- Defined in:
- lib/elasticsearch/persistence/repository/class.rb
Overview
The default repository class, to be used either directly, or as a gateway in a custom repository class
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#host ⇒ nil, Class
private
Return the “host” class, if this repository is a gateway hosted in another class.
-
#initialize(options = {}, &block) ⇒ Class
constructor
A new instance of Class.
Methods included from Search
Methods included from QueryCache
Methods included from Find
#__find_many, #__find_one, #exists?, #find
Methods included from Store
Methods included from Serialize
Methods included from Naming
#__extract_id_from_document, #__get_id_from_document, #__get_klass_from_type, #__get_type_from_class, #document_type, #document_type=, #index_name, #index_name=, #klass, #klass=
Methods included from Client::ClassMethods
Constructor Details
#initialize(options = {}, &block) ⇒ Class
Returns a new instance of Class.
52 53 54 55 56 |
# File 'lib/elasticsearch/persistence/repository/class.rb', line 52 def initialize(={}, &block) @options = index_name .delete(:index) block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
50 51 52 |
# File 'lib/elasticsearch/persistence/repository/class.rb', line 50 def @options end |
Instance Method Details
#host ⇒ nil, Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the “host” class, if this repository is a gateway hosted in another class
64 65 66 |
# File 'lib/elasticsearch/persistence/repository/class.rb', line 64 def host [:host] end |