Class: SimpleAMS::Renderer::Collection
- Inherits:
-
Object
- Object
- SimpleAMS::Renderer::Collection
- Defined in:
- lib/simple_ams/renderer.rb
Instance Method Summary collapse
- #as_json ⇒ Object
- #folder ⇒ Object
-
#initialize(collection, options = {}) ⇒ Collection
constructor
A new instance of Collection.
- #to_json(*_args) ⇒ Object
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, = {}) @collection = collection @options = SimpleAMS::Options.new( collection, injected_options: .merge(_internal: is_collection) ) end |
Instance Method Details
#as_json ⇒ Object
39 40 41 |
# File 'lib/simple_ams/renderer.rb', line 39 def as_json .adapter.klass::Collection.new(folder, .adapter.).as_json end |
#folder ⇒ Object
35 36 37 |
# File 'lib/simple_ams/renderer.rb', line 35 def folder @folder ||= SimpleAMS::Document::Folder.new() 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 |