Class: Quintype::API::StackCollection
- Inherits:
-
Object
- Object
- Quintype::API::StackCollection
- Includes:
- Enumerable
- Defined in:
- lib/quintype/api/stack_collection.rb
Instance Method Summary collapse
- #each ⇒ Object
- #for_location(location) ⇒ Object
-
#initialize(stacks) ⇒ StackCollection
constructor
A new instance of StackCollection.
Constructor Details
#initialize(stacks) ⇒ StackCollection
Returns a new instance of StackCollection.
5 6 7 |
# File 'lib/quintype/api/stack_collection.rb', line 5 def initialize(stacks) @stacks = stacks end |
Instance Method Details
#each ⇒ Object
9 10 11 |
# File 'lib/quintype/api/stack_collection.rb', line 9 def each @stacks.each { |i| yield i } end |
#for_location(location) ⇒ Object
13 14 15 |
# File 'lib/quintype/api/stack_collection.rb', line 13 def for_location(location) select { |stack| stack.show_on_all_sections? || stack.show_on_locations.include?(location)} end |