Class: PhoneGap::Build::ApiRequest

Inherits:
Object
  • Object
show all
Includes:
HTTMultiParty
Defined in:
lib/phone_gap/build/api_request.rb

Instance Method Summary collapse

Instance Method Details

#delete(path, params = {}) ⇒ Object



32
33
34
35
36
37
38
# 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) ⇒ Object



8
9
10
11
12
13
14
# 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 = {}) ⇒ Object



16
17
18
19
20
21
22
# 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 = {}) ⇒ Object



24
25
26
27
28
29
30
# 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