Class: Quintype::API::StoriesResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



2
3
4
# File 'lib/quintype/api/story.rb', line 2

def params
  @params
end

#storiesObject

Returns the value of attribute stories

Returns:

  • (Object)

    the current value of stories



2
3
4
# File 'lib/quintype/api/story.rb', line 2

def stories
  @stories
end

Instance Method Details

#cache_keys(args = {}) ⇒ Object



15
16
17
# File 'lib/quintype/api/story.rb', line 15

def cache_keys(args = {})
  group_keys(args) + story_keys(args)
end

#eachObject



5
6
7
# File 'lib/quintype/api/story.rb', line 5

def each
  stories.each { |story| yield story }
end

#locationObject



9
10
11
12
13
# File 'lib/quintype/api/story.rb', line 9

def location
  return "section-#{params["section-id"]}" if params["section-id"]
  return "home" if !params["tag"] && !params["section"] && !params["section-name"]
  nil
end

#to_liquidObject



19
20
21
# File 'lib/quintype/api/story.rb', line 19

def to_liquid
  stories
end