Class: Miteru::Downloader

Inherits:
Object
  • Object
show all
Defined in:
lib/miteru/downloader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_dir = "/tmp") ⇒ Downloader

Returns a new instance of Downloader.

Raises:

  • (ArgumentError)


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_dirObject (readonly)

Returns the value of attribute base_dir.



9
10
11
# File 'lib/miteru/downloader.rb', line 9

def base_dir
  @base_dir
end

#memoObject (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