Class: BcCrawler::Track
- Inherits:
-
Object
- Object
- BcCrawler::Track
- Defined in:
- lib/bc_crawler/track.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_downloadable ⇒ Object
readonly
Returns the value of attribute is_downloadable.
-
#is_draft ⇒ Object
readonly
Returns the value of attribute is_draft.
-
#streaming ⇒ Object
readonly
Returns the value of attribute streaming.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#title_link ⇒ Object
readonly
Returns the value of attribute title_link.
-
#track_num ⇒ Object
readonly
Returns the value of attribute track_num.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(release, track) ⇒ Track
constructor
A new instance of Track.
- #to_s ⇒ Object
Constructor Details
#initialize(release, track) ⇒ Track
Returns a new instance of Track.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bc_crawler/track.rb', line 7 def initialize(release, track) @release = release @duration = track['duration'] @track_num = track['track_num'] @is_downloadable = track['is_downloadable'] @streaming = track['streaming'] @is_draft = track['is_draft'] @id = track['id'] @title_link = track['title_link'] @file = track['file'] @title = track['title'] @url = "#{ BcCrawler::Helper.get_base_url(@release.url) }#{ track['title_link'] }" end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def duration @duration end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def file @file end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def id @id end |
#is_downloadable ⇒ Object (readonly)
Returns the value of attribute is_downloadable.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def is_downloadable @is_downloadable end |
#is_draft ⇒ Object (readonly)
Returns the value of attribute is_draft.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def is_draft @is_draft end |
#streaming ⇒ Object (readonly)
Returns the value of attribute streaming.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def streaming @streaming end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def title @title end |
#title_link ⇒ Object (readonly)
Returns the value of attribute title_link.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def title_link @title_link end |
#track_num ⇒ Object (readonly)
Returns the value of attribute track_num.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def track_num @track_num end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/bc_crawler/track.rb', line 4 def url @url end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/bc_crawler/track.rb', line 21 def to_s <<-EOF URL : #{ @url } Track number : #{ @track_num } Track name : #{ @title } Duration : #{ @duration } EOF end |