Class: Sunspot::ClassSet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sunspot/class_set.rb

Instance Method Summary collapse

Constructor Details

#initializeClassSet

Returns a new instance of ClassSet.



5
6
7
# File 'lib/sunspot/class_set.rb', line 5

def initialize
  @name_to_klass = {}
end

Instance Method Details

#<<(klass) ⇒ Object Also known as: add



9
10
11
12
# File 'lib/sunspot/class_set.rb', line 9

def <<(klass)
  @name_to_klass[klass.name.to_sym] = klass
  self
end

#each(&block) ⇒ Object



15
16
17
# File 'lib/sunspot/class_set.rb', line 15

def each(&block)
  @name_to_klass.values.each(&block)
end

#empty?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/sunspot/class_set.rb', line 19

def empty?
  @name_to_klass.empty?
end