Class: DataMapper::Adapters::Sphinx::Index
- Inherits:
-
Object
- Object
- DataMapper::Adapters::Sphinx::Index
- Includes:
- Assertions
- Defined in:
- lib/dm-sphinx-adapter/index.rb
Overview
Sphinx index definition.
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Options.
-
#name ⇒ Object
readonly
Options.
-
#options ⇒ Object
readonly
Options.
Instance Method Summary collapse
-
#delta? ⇒ Boolean
Is the index a delta index.
-
#initialize(model, name, options = {}) ⇒ Index
constructor
Parameters model<DataMapper::Model>:: Your resources model.
Constructor Details
#initialize(model, name, options = {}) ⇒ Index
Parameters
- model<DataMapper::Model>
-
Your resources model.
- name<Symbol, String>
-
The index name.
- options<Hash>
-
Optional arguments.
Options
- :delta<Boolean>
-
Delta index. Delta indexes will be searched last when multiple indexes are defined for a resource. Default is false.
21 22 23 24 25 26 27 28 29 |
# File 'lib/dm-sphinx-adapter/index.rb', line 21 def initialize(model, name, = {}) assert_kind_of 'model', model, Model assert_kind_of 'name', name, Symbol, String assert_kind_of 'options', , Hash @model = model @name = name.to_sym @delta = .fetch(:delta, false) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Options.
10 11 12 |
# File 'lib/dm-sphinx-adapter/index.rb', line 10 def model @model end |
#name ⇒ Object (readonly)
Options.
10 11 12 |
# File 'lib/dm-sphinx-adapter/index.rb', line 10 def name @name end |
#options ⇒ Object (readonly)
Options.
10 11 12 |
# File 'lib/dm-sphinx-adapter/index.rb', line 10 def @options end |
Instance Method Details
#delta? ⇒ Boolean
Is the index a delta index.
32 33 34 |
# File 'lib/dm-sphinx-adapter/index.rb', line 32 def delta? !!@delta end |