Class: Ari::Sound
Instance Attribute Summary collapse
-
#formats ⇒ Object
Returns the value of attribute formats.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
-
.get(options = {}) ⇒ Object
GET /sounds/%soundId.
-
.list(options = {}) ⇒ Object
GET /sounds.
Instance Method Summary collapse
Methods inherited from Resource
#add_listener, client, #client, #remove_all_listeners!, #remove_listener
Methods inherited from Model
Constructor Details
This class inherits a constructor from Ari::Model
Instance Attribute Details
#formats ⇒ Object
Returns the value of attribute formats.
15 16 17 |
# File 'lib/ari/resources/sound.rb', line 15 def formats @formats end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/ari/resources/sound.rb', line 15 def id @id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
15 16 17 |
# File 'lib/ari/resources/sound.rb', line 15 def text @text end |
Class Method Details
.get(options = {}) ⇒ Object
GET /sounds/%soundId
Individual sound
Parameters:
soundId (required) - Sound’s id
47 48 49 50 51 52 |
# File 'lib/ari/resources/sound.rb', line 47 def self.get( = {}) raise ArgumentError.new("Parameter soundId must be passed in options hash.") unless [:soundId] path = '/sounds/%{soundId}' % response = client().get(path, ) Sound.new(response.merge(client: [:client])) end |
.list(options = {}) ⇒ Object
GET /sounds
Sounds
Parameters:
lang - Lookup sound for a specific language. format - Lookup sound in a specific format.
32 33 34 35 36 |
# File 'lib/ari/resources/sound.rb', line 32 def self.list( = {}) path = '/sounds' response = client().get(path, ) response.map { |hash| Sound.new(hash.merge(client: [:client])) } end |
Instance Method Details
#get(options = {}) ⇒ Object
54 55 56 |
# File 'lib/ari/resources/sound.rb', line 54 def get( = {}) self.class.get(.merge(soundId: self.id, client: @client)) end |