class RubyFm::Artist

Attributes

images[R]
listeners[R]
mbid[R]
name[R]
streamable[R]
url[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/ruby_fm/artist.rb, line 8
def initialize(attributes)
  @name = attributes['name']
  @listeners = attributes['listeners']
  @mbid = attributes['mbid']
  @streamable = attributes['streamable']
  @url = attributes['url']
  @images = attributes['image'].map do |image|
    image['#text']
  end
end

Protected Class Methods

connection() click to toggle source
# File lib/ruby_fm/artist.rb, line 39
def connection
  conn ||= Faraday.new(:url => 'http://ws.audioscrobbler.com') do |faraday|
    faraday.request  :url_encoded             # form-encode POST params
    faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP
  end
end