Class: Miteru::Downloader
- Inherits:
-
Object
- Object
- Miteru::Downloader
- Defined in:
- lib/miteru/downloader.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#memo ⇒ Object
readonly
Returns the value of attribute memo.
Instance Method Summary collapse
- #download_kits(kits) ⇒ Object
-
#initialize(base_dir = "/tmp") ⇒ Downloader
constructor
A new instance of Downloader.
Constructor Details
#initialize(base_dir = "/tmp") ⇒ Downloader
Returns a new instance of Downloader.
11 12 13 14 15 |
# File 'lib/miteru/downloader.rb', line 11 def initialize(base_dir = "/tmp") @base_dir = base_dir @memo = {} raise ArgumentError, "#{base_dir} doesn't exist." unless Dir.exist?(base_dir) end |
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
9 10 11 |
# File 'lib/miteru/downloader.rb', line 9 def base_dir @base_dir end |
#memo ⇒ Object (readonly)
Returns the value of attribute memo.
9 10 11 |
# File 'lib/miteru/downloader.rb', line 9 def memo @memo end |
Instance Method Details
#download_kits(kits) ⇒ Object
17 18 19 |
# File 'lib/miteru/downloader.rb', line 17 def download_kits(kits) kits.each { |kit| download_kit kit } end |