Class: PuzzlyApiPlugin::CachesView

Inherits:
Renderable show all
Defined in:
lib/puzzly_api_plugin/view/caches.rb

Constant Summary collapse

API_ENDPOINT =
'caches/home'

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Renderable

#apis, #caches, #contexts, #modules, #path, #queries, #render, #schemas, #tables, #topics

Methods inherited from JSONable

#copy_to_hash, #to_s

Constructor Details

#initialize(caches) ⇒ CachesView

Returns a new instance of CachesView.



18
19
20
21
# File 'lib/puzzly_api_plugin/view/caches.rb', line 18

def initialize(caches)
  super(API_ENDPOINT)
  self.caches caches
end

Class Method Details

.createObject



8
9
10
11
12
13
14
15
16
# File 'lib/puzzly_api_plugin/view/caches.rb', line 8

def self.create
  caches = []

  CachesCollection.instance.each do |id, cache|
    caches.push CacheView.create(cache)
  end

  CachesView.new(caches)
end