class EchoNest::Response
Attributes
data[R]
data attr is a Hashie::Mash you can use to get at json attributes returned ex: response.data.artist.name, response.data.artist.name etc
raw_json[R]
data attr is a Hashie::Mash you can use to get at json attributes returned ex: response.data.artist.name, response.data.artist.name etc
request[R]
data attr is a Hashie::Mash you can use to get at json attributes returned ex: response.data.artist.name, response.data.artist.name etc
status[R]
data attr is a Hashie::Mash you can use to get at json attributes returned ex: response.data.artist.name, response.data.artist.name etc
Public Class Methods
new(opts={})
click to toggle source
# File lib/another_echonest_ruby_api/response.rb, line 11 def initialize(opts={}) @request = opts[:request] @raw_json = opts[:raw_json] h = JSON.parse(@raw_json) @data = Hashie::Mash.new(h['response']) @status = data.status end
Public Instance Methods
error?()
click to toggle source
# File lib/another_echonest_ruby_api/response.rb, line 19 def error? status.code != 0 end
message()
click to toggle source
# File lib/another_echonest_ruby_api/response.rb, line 23 def message status.message end
version()
click to toggle source
# File lib/another_echonest_ruby_api/response.rb, line 27 def version status.version end