Class: DataMapper::SphinxIndex

Inherits:
Object
  • Object
show all
Includes:
Assertions
Defined in:
lib/dm-sphinx-adapter/sphinx_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, name, options = {}) ⇒ SphinxIndex

Returns a new instance of SphinxIndex.



7
8
9
10
11
12
13
14
15
# File 'lib/dm-sphinx-adapter/sphinx_index.rb', line 7

def initialize(model, name, options = {})
  assert_kind_of 'model',   model,   Model
  assert_kind_of 'name',    name,    Symbol, String
  assert_kind_of 'options', options, Hash

  @model = model
  @name  = name.to_sym
  @delta = options.fetch(:delta, nil)
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



5
6
7
# File 'lib/dm-sphinx-adapter/sphinx_index.rb', line 5

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/dm-sphinx-adapter/sphinx_index.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/dm-sphinx-adapter/sphinx_index.rb', line 5

def options
  @options
end

Instance Method Details

#delta?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/dm-sphinx-adapter/sphinx_index.rb', line 17

def delta?
  !!@delta
end