Class: Quintype::API::StackCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/quintype/api/stack_collection.rb

Instance Method Summary collapse

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

#eachObject



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