Sha256: 3609a7c0f470262f099222f4b4b1ca04ee70521c5dada78f657f0f4ccc8abd51

Contents?: true

Size: 355 Bytes

Versions: 44

Compression:

Stored size: 355 Bytes

Contents

module Sunspot
  class ClassSet
    include Enumerable

    def initialize
      @name_to_klass = {}
    end

    def <<(klass)
      @name_to_klass[klass.name.to_sym] = klass
      self
    end
    alias_method :add, :<<

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

    def empty?
      @name_to_klass.empty?
    end
  end
end

Version data entries

44 entries across 44 versions & 7 rubygems

Version Path
gojee-sunspot-2.0.5 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.120925 lib/sunspot/class_set.rb
sunspot_solr-2.0.0.pre.120924 sunspot/lib/sunspot/class_set.rb
sunspot_rails-2.0.0.pre.120924 sunspot/lib/sunspot/class_set.rb
sunspot-2.0.0.pre.120924 sunspot/lib/sunspot/class_set.rb
gojee-sunspot-2.0.4 lib/sunspot/class_set.rb
gojee-sunspot-2.0.2 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.120720 lib/sunspot/class_set.rb
sunspot-1.3.3 lib/sunspot/class_set.rb
sunspot-1.3.2 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.120417 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.120415 lib/sunspot/class_set.rb
sunspot-1.3.1 lib/sunspot/class_set.rb
erichummel-sunspot-2.0.0.pre.111215d lib/sunspot/class_set.rb
erichummel-sunspot-2.0.0.pre.111215c lib/sunspot/class_set.rb
erichummel-sunspot-2.0.0.pre.111215b lib/sunspot/class_set.rb
erichummel-sunspot-2.0.0.pre.111215a lib/sunspot/class_set.rb
erichummel-sunspot-2.0.0.pre.111215 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.111215 lib/sunspot/class_set.rb
cb_sunspot-2.0.0.pre.5 lib/sunspot/class_set.rb