Class: YoutubeDL::State
- Inherits:
-
Object
- Object
- YoutubeDL::State
- Defined in:
- lib/youtube_dl/state.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#error ⇒ Object
Returns the value of attribute error.
-
#info ⇒ Object
Returns the value of attribute info.
-
#info_json ⇒ Object
Returns the value of attribute info_json.
-
#merger ⇒ Object
Returns the value of attribute merger.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#speed ⇒ Object
Returns the value of attribute speed.
-
#total_size ⇒ Object
Returns the value of attribute total_size.
Instance Method Summary collapse
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def destination @destination end |
#error ⇒ Object
Returns the value of attribute error.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def error @error end |
#info ⇒ Object
Returns the value of attribute info.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def info @info end |
#info_json ⇒ Object
Returns the value of attribute info_json.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def info_json @info_json end |
#merger ⇒ Object
Returns the value of attribute merger.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def merger @merger end |
#progress ⇒ Object
Returns the value of attribute progress.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def progress @progress end |
#speed ⇒ Object
Returns the value of attribute speed.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def speed @speed end |
#total_size ⇒ Object
Returns the value of attribute total_size.
5 6 7 |
# File 'lib/youtube_dl/state.rb', line 5 def total_size @total_size end |
Instance Method Details
#complete? ⇒ Boolean
21 22 23 |
# File 'lib/youtube_dl/state.rb', line 21 def complete? destination&.exist? && (info || info_json&.exist?) end |
#error? ⇒ Boolean
17 18 19 |
# File 'lib/youtube_dl/state.rb', line 17 def error? !error.nil? end |
#load_and_delete_info_json ⇒ Object
25 26 27 28 |
# File 'lib/youtube_dl/state.rb', line 25 def load_and_delete_info_json self.info = JSON.parse(info_json.read()) info_json.unlink() end |