Class: SimpleAMS::Renderer::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_ams/renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(collection, options = {}) ⇒ Collection

Returns a new instance of Collection.



27
28
29
30
31
32
33
# File 'lib/simple_ams/renderer.rb', line 27

def initialize(collection, options = {})
  @collection = collection
  @options = SimpleAMS::Options.new(
    collection,
    injected_options: options.merge(_internal: is_collection)
  )
end

Instance Method Details

#as_jsonObject



39
40
41
# File 'lib/simple_ams/renderer.rb', line 39

def as_json
  options.adapter.klass::Collection.new(folder, options.adapter.options).as_json
end

#folderObject



35
36
37
# File 'lib/simple_ams/renderer.rb', line 35

def folder
  @folder ||= SimpleAMS::Document::Folder.new(options)
end

#to_json(*_args) ⇒ Object



43
44
45
# File 'lib/simple_ams/renderer.rb', line 43

def to_json(*_args)
  as_json.to_json
end