Class: PuzzlyApiPlugin::TopicsView
- Inherits:
-
Renderable
- Object
- Hash
- JSONable
- Renderable
- PuzzlyApiPlugin::TopicsView
- Defined in:
- lib/puzzly_api_plugin/view/topics.rb
Constant Summary collapse
- API_ENDPOINT =
'topics/home'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(topics) ⇒ TopicsView
constructor
A new instance of TopicsView.
Methods inherited from Renderable
#apis, #caches, #contexts, #modules, #path, #queries, #render, #schemas, #tables, #topics
Methods inherited from JSONable
Constructor Details
#initialize(topics) ⇒ TopicsView
Returns a new instance of TopicsView.
18 19 20 21 |
# File 'lib/puzzly_api_plugin/view/topics.rb', line 18 def initialize(topics) super(API_ENDPOINT) self.topics topics end |
Class Method Details
.create ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/puzzly_api_plugin/view/topics.rb', line 8 def self.create topics = [] TopicsCollection.instance.each do |id, topic| topics.push TopicView.create(topic) end TopicsView.new(topics) end |