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
sunspot-2.7.1 lib/sunspot/class_set.rb
sunspot-2.7.0 lib/sunspot/class_set.rb
sunspot-2.6.0 lib/sunspot/class_set.rb
sunspot-2.5.0 lib/sunspot/class_set.rb
sunspot-2.4.0 lib/sunspot/class_set.rb
sunspot-2.3.0 lib/sunspot/class_set.rb
sunspot-2.2.8 lib/sunspot/class_set.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/lib/sunspot/class_set.rb
sunspot-2.2.7 lib/sunspot/class_set.rb
sunspot-2.2.6 lib/sunspot/class_set.rb
sunspot-2.2.5 lib/sunspot/class_set.rb
sunspot-2.2.4 lib/sunspot/class_set.rb
sunspot-2.2.3 lib/sunspot/class_set.rb
sunspot-2.2.2 lib/sunspot/class_set.rb
sunspot-2.2.1 lib/sunspot/class_set.rb
sunspot-2.2.0 lib/sunspot/class_set.rb
sunspot-2.1.1 lib/sunspot/class_set.rb
sunspot-2.1.0 lib/sunspot/class_set.rb
sunspot-2.0.0 lib/sunspot/class_set.rb
sunspot-2.0.0.pre.130115 lib/sunspot/class_set.rb