Class: TentClient::App

Inherits:
Object
  • Object
show all
Defined in:
lib/tent-client/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ App

Returns a new instance of App.



5
6
7
# File 'lib/tent-client/app.rb', line 5

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/tent-client/app.rb', line 3

def client
  @client
end

Instance Method Details

#authorizationObject



29
30
31
# File 'lib/tent-client/app.rb', line 29

def authorization
  AppAuthorization.new(@client)
end

#create(data) ⇒ Object



9
10
11
# File 'lib/tent-client/app.rb', line 9

def create(data)
  @client.http.post("apps", data)
end

#delete(id) ⇒ Object



21
22
23
# File 'lib/tent-client/app.rb', line 21

def delete(id)
  @client.http.delete("apps/#{id}")
end

#get(id) ⇒ Object



13
14
15
# File 'lib/tent-client/app.rb', line 13

def get(id)
  @client.http.get("apps/#{id}")
end

#list(params = {}) ⇒ Object



17
18
19
# File 'lib/tent-client/app.rb', line 17

def list(params = {})
  @client.http.get("apps", params)
end

#update(id, data) ⇒ Object



25
26
27
# File 'lib/tent-client/app.rb', line 25

def update(id, data)
  @client.http.put("apps/#{id}", data)
end