Class: Pandora::User

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Client
Defined in:
lib/pandora/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(partner, username, password) ⇒ User

Returns a new instance of User.



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

def initialize(partner, username, password)
  @partner, @username, @password = partner, username, password
  
end

Instance Attribute Details

#partnerObject (readonly)

Returns the value of attribute partner.



10
11
12
# File 'lib/pandora/user.rb', line 10

def partner
  @partner
end

#passwordObject (readonly)

Returns the value of attribute password.



10
11
12
# File 'lib/pandora/user.rb', line 10

def password
  @password
end

#user_auth_tokenObject (readonly)

Returns the value of attribute user_auth_token.



11
12
13
# File 'lib/pandora/user.rb', line 11

def user_auth_token
  @user_auth_token
end

#user_idObject (readonly)

Returns the value of attribute user_id.



11
12
13
# File 'lib/pandora/user.rb', line 11

def user_id
  @user_id
end

#usernameObject (readonly)

Returns the value of attribute username.



10
11
12
# File 'lib/pandora/user.rb', line 10

def username
  @username
end

Instance Method Details

#marshal_dumpObject



27
28
29
# File 'lib/pandora/user.rb', line 27

def marshal_dump
  [@partner, @username, @password, @user_auth_token, @user_id]
end

#marshal_load(objects) ⇒ Object



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

def marshal_load(objects)
  @partner, @username, @password, @user_auth_token, @user_id = objects
end

#stationsObject



21
22
23
24
25
# File 'lib/pandora/user.rb', line 21

def stations
  call('user.getStationList')['stations'].map do |station_data|
    Station.new(self, station_data)
  end
end