class PhoneGap::Build::ApiRequest
Public Instance Methods
delete(path, params = {})
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 32 def delete(path, params = {}) if credentials? self.class.delete("#{path}?auth_token=#{token}") else credentials_not_found end end
get(path)
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 8 def get(path) if credentials? self.class.get("#{path}?auth_token=#{token}") else credentials_not_found end end
post(path, params = {})
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 16 def post(path, params = {}) if credentials? self.class.post("#{path}?auth_token=#{token}", query: params[:query]) else credentials_not_found end end
put(path, params = {})
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 24 def put(path, params = {}) if credentials? self.class.put("#{path}?auth_token=#{token}", query: params[:query]) else credentials_not_found end end
Private Instance Methods
credentials?()
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 42 def credentials? if PhoneGap::Build::Credentials.instance.token true else Credentials.instance.load PhoneGap::Build::Credentials.instance.token end end
credentials_not_found()
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 51 def credentials_not_found Error.new(message: 'Api credentials not found. Set them or add them to config/phonegap.yml') end
token()
click to toggle source
# File lib/phone_gap/build/api_request.rb, line 55 def token PhoneGap::Build::Credentials.instance.token end