Class: ElasticRecord::Index
- Inherits:
-
Object
- Object
- ElasticRecord::Index
- Defined in:
- lib/elastic_record/index.rb,
lib/elastic_record/index/manage.rb,
lib/elastic_record/index/mapping.rb,
lib/elastic_record/index/documents.rb
Defined Under Namespace
Modules: Documents, Manage, Mapping
Instance Attribute Summary collapse
-
#disabled ⇒ Object
Returns the value of attribute disabled.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
- #alias_name ⇒ Object
- #disable! ⇒ Object
- #enable! ⇒ Object
-
#initialize(model) ⇒ Index
constructor
A new instance of Index.
- #type ⇒ Object
Methods included from Mapping
Methods included from Manage
#aliased_names, #all_names, #create, #create_and_deploy, #delete, #delete_all, #deploy, #exists?, #refresh, #reset, #update_mapping
Methods included from Documents
#bulk_add, #delete_record, #index_record, #record_exists?
Constructor Details
#initialize(model) ⇒ Index
Returns a new instance of Index.
14 15 16 17 |
# File 'lib/elastic_record/index.rb', line 14 def initialize(model) @model = model @disabled = false end |
Instance Attribute Details
#disabled ⇒ Object
Returns the value of attribute disabled.
12 13 14 |
# File 'lib/elastic_record/index.rb', line 12 def disabled @disabled end |
#model ⇒ Object
Returns the value of attribute model.
11 12 13 |
# File 'lib/elastic_record/index.rb', line 11 def model @model end |
Instance Method Details
#alias_name ⇒ Object
19 20 21 |
# File 'lib/elastic_record/index.rb', line 19 def alias_name @alias_name ||= model.base_class.model_name.collection end |
#disable! ⇒ Object
27 28 29 |
# File 'lib/elastic_record/index.rb', line 27 def disable! @disabled = true end |
#enable! ⇒ Object
31 32 33 |
# File 'lib/elastic_record/index.rb', line 31 def enable! @disabled = false end |
#type ⇒ Object
23 24 25 |
# File 'lib/elastic_record/index.rb', line 23 def type @type ||= model.base_class.model_name.element end |