Class: Freesound::Collections::Base

Inherits:
ActiveResource::Collection
  • Object
show all
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.

Direct Known Subclasses

Packs, Sounds

Instance Method Summary collapse

Constructor Details

#initialize(parsed = {}) ⇒ Base



12
13
14
# File 'lib/freesound/collections.rb', line 12

def initialize(parsed={})
  @elements = parsed.fetch(__collection_key)
end