Class: NightcrawlerSwift::Download

Inherits:
Command
  • Object
show all
Defined in:
lib/nightcrawler_swift/commands/download.rb

Instance Method Summary collapse

Methods inherited from Command

#connection, #options

Instance Method Details

#execute(path) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/nightcrawler_swift/commands/download.rb', line 4

def execute path
  if path.nil? or path.empty?
    raise Exceptions::ValidationError.new "Download command requires a path parameter"
  end

  response = get "#{connection.internal_url}/#{options.bucket}/#{path}"
  response.body
end