Class: Bandcamp::Track
Instance Attribute Summary collapse
-
#about ⇒ Object
readonly
Returns the value of attribute about.
-
#album_id ⇒ Object
readonly
Returns the value of attribute album_id.
-
#band_id ⇒ Object
readonly
Returns the value of attribute band_id.
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#downloadable ⇒ Object
readonly
Returns the value of attribute downloadable.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#lyrics ⇒ Object
readonly
Returns the value of attribute lyrics.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#streaming_url ⇒ Object
readonly
Returns the value of attribute streaming_url.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#track_id ⇒ Object
readonly
Returns the value of attribute track_id.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #album ⇒ Object
- #band ⇒ Object
-
#initialize(track) ⇒ Track
constructor
A new instance of Track.
Methods inherited from Base
Constructor Details
#initialize(track) ⇒ Track
Returns a new instance of Track.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/bandcamp.rb', line 100 def initialize(track) @lyrics = track['lyrics'] @downloadable = track['downloadable'] @duration = track['duration'] @about = track['about'] @album_id = track['album_id'] @credits = track['credits'] @streaming_url = track['streaming_url'] @number = track['number'] @title = track['title'] @url = track['url'] @track_id = track['track_id'] @band_id = track['band_id'] end |
Instance Attribute Details
#about ⇒ Object (readonly)
Returns the value of attribute about.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def about @about end |
#album_id ⇒ Object (readonly)
Returns the value of attribute album_id.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def album_id @album_id end |
#band_id ⇒ Object (readonly)
Returns the value of attribute band_id.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def band_id @band_id end |
#credits ⇒ Object (readonly)
Returns the value of attribute credits.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def credits @credits end |
#downloadable ⇒ Object (readonly)
Returns the value of attribute downloadable.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def downloadable @downloadable end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def duration @duration end |
#lyrics ⇒ Object (readonly)
Returns the value of attribute lyrics.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def lyrics @lyrics end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def number @number end |
#streaming_url ⇒ Object (readonly)
Returns the value of attribute streaming_url.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def streaming_url @streaming_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def title @title end |
#track_id ⇒ Object (readonly)
Returns the value of attribute track_id.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def track_id @track_id end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
97 98 99 |
# File 'lib/bandcamp.rb', line 97 def url @url end |
Class Method Details
.load(id) ⇒ Object
124 125 126 127 |
# File 'lib/bandcamp.rb', line 124 def load(id) response = get("/track/1/info", :query => { :key => Bandcamp::Base.api_key, :track_id => id }) new(response) if response end |
Instance Method Details
#album ⇒ Object
115 116 117 |
# File 'lib/bandcamp.rb', line 115 def album @album ||= Album.load(album_id) end |
#band ⇒ Object
119 120 121 |
# File 'lib/bandcamp.rb', line 119 def band @band ||= Band.load(band_id) end |