Class: Pandora::Song

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

Constant Summary collapse

ALL_AUDIO_FORMATS =
['HTTP_40_AAC_MONO', 'HTTP_64_AAC', 'HTTP_64_AACPLUS',
'HTTP_24_AACPLUS_ADTS', 'HTTP_32_AACPLUS_ADTS', 'HTTP_64_AACPLUS_ADTS',
'HTTP_128_MP3', 'HTTP_192_MP3', 'HTTP_32_WMA']
DEFAULT_AUDIO_FORMATS =
['HTTP_32_AACPLUS_ADTS', 'HTTP_64_AACPLUS_ADTS', 'HTTP_192_MP3']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(station, data, audio_formats) ⇒ Song

Returns a new instance of Song.



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

def initialize(station, data, audio_formats)
  @station = station
  load_from_data(data, audio_formats)
end

Instance Attribute Details

#albumObject (readonly)

Returns the value of attribute album.



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

def album
  @album
end

#album_art_urlObject (readonly)

Returns the value of attribute album_art_url.



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

def album_art_url
  @album_art_url
end

#album_explorer_urlObject (readonly)

Returns the value of attribute album_explorer_url.



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

def album_explorer_url
  @album_explorer_url
end

#album_urlObject (readonly)

Returns the value of attribute album_url.



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

def album_url
  @album_url
end

#allow_feedbackObject (readonly)

Returns the value of attribute allow_feedback.



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

def allow_feedback
  @allow_feedback
end

#amazon_album_asinObject (readonly)

Returns the value of attribute amazon_album_asin.



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

def amazon_album_asin
  @amazon_album_asin
end

#amazon_album_digital_asinObject (readonly)

Returns the value of attribute amazon_album_digital_asin.



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

def amazon_album_digital_asin
  @amazon_album_digital_asin
end

#amazon_album_urlObject (readonly)

Returns the value of attribute amazon_album_url.



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

def amazon_album_url
  @amazon_album_url
end

#amazon_song_digital_asinObject (readonly)

Returns the value of attribute amazon_song_digital_asin.



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

def amazon_song_digital_asin
  @amazon_song_digital_asin
end

#artistObject (readonly)

Returns the value of attribute artist.



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

def artist
  @artist
end

#artist_explorer_urlObject (readonly)

Returns the value of attribute artist_explorer_url.



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

def artist_explorer_url
  @artist_explorer_url
end

#artist_urlObject (readonly)

Returns the value of attribute artist_url.



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

def artist_url
  @artist_url
end

#audio_urlObject (readonly)

Returns the value of attribute audio_url.



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

def audio_url
  @audio_url
end

#audio_urlsObject (readonly)

Returns the value of attribute audio_urls.



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

def audio_urls
  @audio_urls
end

#gainObject (readonly)

Returns the value of attribute gain.



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

def gain
  @gain
end

#itunes_song_urlObject (readonly)

Returns the value of attribute itunes_song_url.



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

def itunes_song_url
  @itunes_song_url
end

#ratingObject (readonly)

Returns the value of attribute rating.



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

def rating
  @rating
end

#song_explorer_urlObject (readonly)

Returns the value of attribute song_explorer_url.



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

def song_explorer_url
  @song_explorer_url
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#tokenObject (readonly)

Returns the value of attribute token.



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

def token
  @token
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#idObject



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

def id
  load_explorer_data unless @id
  @id
end