Class: Freesound::Collections::Base
- Inherits:
-
ActiveResource::Collection
- Object
- ActiveResource::Collection
- Freesound::Collections::Base
- Defined in:
- lib/freesound/collections.rb
Overview
Collections are required to tell ActiveResource how to parse JSON responses that wrap a collection of resources.
The #__collection_key method determines the JSON key containing the resource data.
Instance Method Summary collapse
-
#initialize(parsed = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(parsed = {}) ⇒ Base
12 13 14 |
# File 'lib/freesound/collections.rb', line 12 def initialize(parsed={}) @elements = parsed.fetch(__collection_key) end |