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



11
12
13
14
15
# File 'lib/thinking_sphinx/index_set.rb', line 11

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

Class Method Details

.reference_name(klass) ⇒ Object



4
5
6
7
# File 'lib/thinking_sphinx/index_set.rb', line 4

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

Instance Method Details

#ancestorsObject



17
18
19
# File 'lib/thinking_sphinx/index_set.rb', line 17

def ancestors
  classes_and_ancestors - classes
end

#to_aObject



21
22
23
# File 'lib/thinking_sphinx/index_set.rb', line 21

def to_a
  indices
end