Class: Pandora::Partner

Inherits:
Object
  • Object
show all
Includes:
Client
Defined in:
lib/pandora/partner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password, device, encryption_key, decryption_key) ⇒ Partner

Returns a new instance of Partner.


11
12
13
14
15
# File 'lib/pandora/partner.rb', line 11

def initialize(username, password, device, encryption_key, decryption_key)
  @username, @password, @device, @encryption_key, @decryption_key =
    username, password, device, encryption_key, decryption_key
  authenticate
end

Instance Attribute Details

#decryption_keyObject (readonly)

Returns the value of attribute decryption_key


8
9
10
# File 'lib/pandora/partner.rb', line 8

def decryption_key
  @decryption_key
end

#deviceObject (readonly)

Returns the value of attribute device


8
9
10
# File 'lib/pandora/partner.rb', line 8

def device
  @device
end

#encryption_keyObject (readonly)

Returns the value of attribute encryption_key


8
9
10
# File 'lib/pandora/partner.rb', line 8

def encryption_key
  @encryption_key
end

#partner_auth_tokenObject (readonly)

Returns the value of attribute partner_auth_token


9
10
11
# File 'lib/pandora/partner.rb', line 9

def partner_auth_token
  @partner_auth_token
end

#partner_idObject (readonly)

Returns the value of attribute partner_id


9
10
11
# File 'lib/pandora/partner.rb', line 9

def partner_id
  @partner_id
end

#passwordObject (readonly)

Returns the value of attribute password


8
9
10
# File 'lib/pandora/partner.rb', line 8

def password
  @password
end

#time_offsetObject (readonly)

Returns the value of attribute time_offset


9
10
11
# File 'lib/pandora/partner.rb', line 9

def time_offset
  @time_offset
end

#usernameObject (readonly)

Returns the value of attribute username


8
9
10
# File 'lib/pandora/partner.rb', line 8

def username
  @username
end

Instance Method Details

#login_user(username, password) ⇒ Object


21
22
23
# File 'lib/pandora/partner.rb', line 21

def (username, password)
  User.new(self, username, password)
end

#marshal_dumpObject


25
26
27
28
# File 'lib/pandora/partner.rb', line 25

def marshal_dump
  [@username, @password, @device, @encryption_key, @decryption_key,
    @partner_id, @partner_auth_token, @time_offset]
end

#marshal_load(objects) ⇒ Object


30
31
32
33
# File 'lib/pandora/partner.rb', line 30

def marshal_load(objects)
  @username, @password, @device, @encryption_key, @decryption_key,
    @partner_id, @partner_auth_token, @time_offset = objects
end

#reauthenticateObject


17
18
19
# File 'lib/pandora/partner.rb', line 17

def reauthenticate
  authenticate
end