Class: Scrobbler2::Auth

Inherits:
Base
  • Object
show all
Defined in:
lib/scrobbler2/auth.rb

Instance Method Summary collapse

Methods inherited from Base

get, get_with_auth, has_resource, has_singleton_resource, http_with_auth, post_with_auth, query_signature, sign

Instance Method Details

#sessionObject



13
14
15
16
# File 'lib/scrobbler2/auth.rb', line 13

def session
  return @session if @session
  @session = self.class.get_with_auth("auth.getsession", {:token => token})["lfm"]["session"]
end

#tokenObject



4
5
6
7
# File 'lib/scrobbler2/auth.rb', line 4

def token
  return @token if @token
  @token = self.class.get_with_auth("auth.gettoken")["lfm"]["token"]
end

#urlObject



9
10
11
# File 'lib/scrobbler2/auth.rb', line 9

def url
  "http://www.last.fm/api/auth/?api_key=#{api_key}&token=#{token}"     
end