Class: Scrobbler::BaseXml
Direct Known Subclasses
Instance Method Summary (collapse)
-
- (BaseXml) initialize(data = {})
constructor
Load data out of a XML node.
Methods inherited from Base
add_cache, api_key=, #call, #call_pageable, fetch_http, get, load_from_cache, #populate_data, post_request, #request, request, sanitize, save_to_cache, secret=, validate_response_document
Constructor Details
- (BaseXml) initialize(data = {})
Load data out of a XML node
8 9 10 11 12 13 14 15 16 |
# File 'lib/scrobbler/basexml.rb', line 8 def initialize(data = {}) raise ArgumentError unless data.kind_of?(Hash) super() unless data[:xml].nil? load_from_xml(data[:xml]) data.delete(:xml) end populate_data(data) end |