Class: ThinkingSphinx::IndexSet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/thinking_sphinx/index_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, configuration = nil) ⇒ IndexSet

Returns a new instance of IndexSet.



13
14
15
16
17
# File 'lib/thinking_sphinx/index_set.rb', line 13

def initialize(options = {}, configuration = nil)
  @options       = options
  @index_names   = options[:indices] || []
  @configuration = configuration || ThinkingSphinx::Configuration.instance
end

Class Method Details

.reference_name(klass) ⇒ Object



6
7
8
9
# File 'lib/thinking_sphinx/index_set.rb', line 6

def self.reference_name(klass)
  @cached_results ||= {}
  @cached_results[klass.name] ||= klass.name.underscore.to_sym
end

Instance Method Details

#ancestorsObject



19
20
21
# File 'lib/thinking_sphinx/index_set.rb', line 19

def ancestors
  classes_and_ancestors - classes
end

#to_aObject



23
24
25
# File 'lib/thinking_sphinx/index_set.rb', line 23

def to_a
  indices
end