Sha256: 0f4946428fc44d789aca4a7223b231dc47e86793fb5204a5ba40e0d1abf8855b
Contents?: true
Size: 403 Bytes
Versions: 10
Compression:
Stored size: 403 Bytes
Contents
require 'rubygems' require 'xmlsimple' class Lastfm class Response attr_reader :xml def initialize(body) @xml = XmlSimple.xml_in(body, 'ForceArray' => ['image', 'tag', 'user', 'event', 'correction']) end def success? @xml['status'] == 'ok' end def message @xml['error']['content'] end def error @xml['error']['code'].to_i end end end
Version data entries
10 entries across 10 versions & 1 rubygems