Class: Scrobbler::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/scrobbler/base.rb

Direct Known Subclasses

Album, Artist, Chart, Tag, Track, User

Class Method Summary collapse

Class Method Details

.connectionObject



8
9
10
# File 'lib/scrobbler/base.rb', line 8

def connection
  @connection ||= REST::Connection.new(API_URL)
end

.fetch_and_parse(resource) ⇒ Object



12
13
14
# File 'lib/scrobbler/base.rb', line 12

def fetch_and_parse(resource)
  Hpricot::XML(connection.get(resource))
end