Class: Spree::Core::ClassConstantizer::Set
- Inherits:
-
Object
- Object
- Spree::Core::ClassConstantizer::Set
- Includes:
- Enumerable
- Defined in:
- lib/spree/core/class_constantizer.rb
Instance Method Summary collapse
- #<<(klass) ⇒ Object
- #concat(klasses) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize ⇒ Set
Returns a new instance of Set.
7 8 9 |
# File 'lib/spree/core/class_constantizer.rb', line 7 def initialize @collection = ::Set.new end |
Instance Method Details
#<<(klass) ⇒ Object
11 12 13 |
# File 'lib/spree/core/class_constantizer.rb', line 11 def <<(klass) @collection << klass.to_s end |
#concat(klasses) ⇒ Object
15 16 17 18 19 |
# File 'lib/spree/core/class_constantizer.rb', line 15 def concat(klasses) klasses.each do |klass| self << klass end end |
#each ⇒ Object
23 24 25 26 27 |
# File 'lib/spree/core/class_constantizer.rb', line 23 def each @collection.each do |klass| yield klass.constantize end end |