Class: API::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/quintype/api/stack.rb

Class Method Summary collapse

Class Method Details

.allObject



4
5
6
# File 'lib/quintype/api/stack.rb', line 4

def all
  API.config['layout']['stacks']
end

.with_stories(params = {}, config = {}) ⇒ Object

TODO filter by stacks



8
9
10
11
12
13
14
15
# File 'lib/quintype/api/stack.rb', line 8

def with_stories(params={}, config={})
  stories_with_stacks = API::Story.find_by_stacks(all, params)
  stacks = all.map do |stack|
    stories = stories_with_stacks[stack['story_group'].gsub('-', '_')]
    stack['stories'] = stories
    stack
  end
end