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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



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

def method_missing(method, *args)
  stories.send(method, *args)
end

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



23
24
25
# File 'lib/quintype/api/story.rb', line 23

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



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

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

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/quintype/api/story.rb', line 13

def respond_to?(method)
  super || stories.respond_to?(method)
end

#to_liquidObject



27
28
29
# File 'lib/quintype/api/story.rb', line 27

def to_liquid
  stories
end