Class: Show
- Inherits:
-
Object
- Object
- Show
- Defined in:
- lib/deadlist/models/show.rb
Overview
Object to handle Show data and the array of Track objects to be used in downloading.
Instance Attribute Summary collapse
-
#available_formats ⇒ Object
readonly
Returns the value of attribute available_formats.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tracks ⇒ Object
readonly
Returns the value of attribute tracks.
-
#transferred_by ⇒ Object
readonly
Returns the value of attribute transferred_by.
-
#venue ⇒ Object
readonly
Returns the value of attribute venue.
Instance Method Summary collapse
-
#download_tracks(path) ⇒ Object
Initializes a Downloader and passes track details.
-
#initialize(show_id, format) ⇒ Show
constructor
A new instance of Show.
Constructor Details
#initialize(show_id, format) ⇒ Show
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/deadlist/models/show.rb', line 5 def initialize(show_id, format) @show_id = show_id @format = format @name = nil @date = nil @location = nil @venue = nil @duration = nil @transferred_by = nil @url = nil @tracks = nil set_show_info end |
Instance Attribute Details
#available_formats ⇒ Object (readonly)
Returns the value of attribute available_formats.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def available_formats @available_formats end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def date @date end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def duration @duration end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def name @name end |
#tracks ⇒ Object (readonly)
Returns the value of attribute tracks.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def tracks @tracks end |
#transferred_by ⇒ Object (readonly)
Returns the value of attribute transferred_by.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def transferred_by @transferred_by end |
#venue ⇒ Object (readonly)
Returns the value of attribute venue.
3 4 5 |
# File 'lib/deadlist/models/show.rb', line 3 def venue @venue end |
Instance Method Details
#download_tracks(path) ⇒ Object
Initializes a Downloader and passes track details
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/deadlist/models/show.rb', line 21 def download_tracks(path) dl = Downloader.new(path, @format) download_url = dl.download_url_for_show(@show_id) @tracks.each do |track| dl.get(download_url, track) puts "⚡️ #{track.pos} - #{track.title} downloaded successfully" end end |