Class: Sunspot::ClassSet
- Inherits:
-
Object
- Object
- Sunspot::ClassSet
- Includes:
- Enumerable
- Defined in:
- sunspot/lib/sunspot/class_set.rb
Instance Method Summary (collapse)
- - (Object) <<(klass) (also: #add)
- - (Object) each(&block)
- - (Boolean) empty?
-
- (ClassSet) initialize
constructor
A new instance of ClassSet.
Constructor Details
- (ClassSet) initialize
A new instance of ClassSet
5 6 7 |
# File 'sunspot/lib/sunspot/class_set.rb', line 5 def initialize @name_to_klass = {} end |
Instance Method Details
- (Object) <<(klass) Also known as: add
9 10 11 12 |
# File 'sunspot/lib/sunspot/class_set.rb', line 9 def <<(klass) @name_to_klass[klass.name.to_sym] = klass self end |
- (Object) each(&block)
15 16 17 |
# File 'sunspot/lib/sunspot/class_set.rb', line 15 def each(&block) @name_to_klass.values.each(&block) end |
- (Boolean) empty?
19 20 21 |
# File 'sunspot/lib/sunspot/class_set.rb', line 19 def empty? @name_to_klass.empty? end |