Module: Download

Defined in:
lib/download.rb,
lib/download/version.rb

Defined Under Namespace

Classes: Object

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.file(*args) ⇒ Object

first argumnet is url, required second argument is path, optional third argument is open-uri options, optional



63
64
65
66
67
68
69
# File 'lib/download.rb', line 63

def file(*args)
  Download::Object.new(
      url: args.shift,
      path: (args[0].is_a?(String) ? args[0] : nil),
      options: (args.last.is_a?(Hash) ? args.last : nil)
  ).start
end