Class: TorrentSearch::Views::Download
- Inherits:
-
Base
- Object
- Base
- TorrentSearch::Views::Download
show all
- Defined in:
- lib/torrent_search/views/download.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #invalid_command!, #invalid_option!
Instance Method Details
#directory?(default) ⇒ Boolean
9
10
11
|
# File 'lib/torrent_search/views/download.rb', line 9
def directory?(default)
ask "Directory to save file (default '#{default}'):"
end
|
#downloading!(torrent) ⇒ Object
13
14
15
|
# File 'lib/torrent_search/views/download.rb', line 13
def downloading!(torrent)
say "Downloading #{torrent.name}...", :blue
end
|
#failure(error, href) ⇒ Object
21
22
23
|
# File 'lib/torrent_search/views/download.rb', line 21
def failure(error, href)
say "Error: #{error.message} - #{href}", :red
end
|
#open? ⇒ Boolean
25
26
27
|
# File 'lib/torrent_search/views/download.rb', line 25
def open?
yes? 'Open? (y/n):'
end
|
#success ⇒ Object
17
18
19
|
# File 'lib/torrent_search/views/download.rb', line 17
def success
say 'Complete', :green
end
|
#torrent?(max) ⇒ Boolean
5
6
7
|
# File 'lib/torrent_search/views/download.rb', line 5
def torrent?(max)
ask("Torrent (0-#{max}):")
end
|