Class: PhoneGap::Build::PackageDownloader

Inherits:
Object
  • Object
show all
Defined in:
lib/phone_gap/build/package_downloader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#http_responseObject (readonly)

Returns the value of attribute http_response.



5
6
7
# File 'lib/phone_gap/build/package_downloader.rb', line 5

def http_response
  @http_response
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/phone_gap/build/package_downloader.rb', line 5

def id
  @id
end

#platformObject (readonly)

Returns the value of attribute platform.



5
6
7
# File 'lib/phone_gap/build/package_downloader.rb', line 5

def platform
  @platform
end

#target_dirObject (readonly)

Returns the value of attribute target_dir.



5
6
7
# File 'lib/phone_gap/build/package_downloader.rb', line 5

def target_dir
  @target_dir
end

Instance Method Details

#download(id, platform, target_dir = '/tmp') ⇒ Object



7
8
9
10
11
# File 'lib/phone_gap/build/package_downloader.rb', line 7

def download(id, platform, target_dir = '/tmp')
  @id, @platform, @target_dir = id, platform, target_dir
  @http_response = PhoneGap::Build::ApiRequest.new.get("/apps/#{id}/#{platform}")
  save_file if http_response.success?
end