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