Class: Freesound::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tweet_to_sounds/freesound_ext.rb

Instance Method Summary collapse

Instance Method Details

#soundsObject



23
24
25
26
27
28
29
30
31
# File 'lib/tweet_to_sounds/freesound_ext.rb', line 23

def sounds
  return [] if errors[:error]

  @sounds ||= data.map do |sound|
    result = Sound.new
    sound.each { |k, v| result.send("#{k}=", v) }
    result
  end
end