Class: Heroku::Client::Api

Inherits:
Object
  • Object
show all
Includes:
Http
Defined in:
lib/heroku-client/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Http

#get

Constructor Details

#initialize(apikey) ⇒ Api

Returns a new instance of Api.



44
45
46
# File 'lib/heroku-client/api.rb', line 44

def initialize(apikey)
  @apikey = apikey
end

Instance Attribute Details

#apikeyObject (readonly)

Returns the value of attribute apikey.



6
7
8
# File 'lib/heroku-client/api.rb', line 6

def apikey
  @apikey
end

Instance Method Details

#apps(*args) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/heroku-client/api.rb', line 8

def apps(*args)
  return get("apps") if args.size == 0

  return get("apps/#{args[0]}") if args.size == 1

  raise "Invalid number of parameters"
end

#collaborators(app_name) ⇒ Object



16
17
18
# File 'lib/heroku-client/api.rb', line 16

def collaborators(app_name)
  return get("apps/#{app_name}/collaborators")
end

#config_vars(app_name) ⇒ Object



20
21
22
# File 'lib/heroku-client/api.rb', line 20

def config_vars(app_name)
  return get("apps/#{app_name}/config_vars")
end

#domains(app_name) ⇒ Object



24
25
26
# File 'lib/heroku-client/api.rb', line 24

def domains(app_name)
  return get("apps/#{app_name}/domains")
end

#keysObject



28
29
30
# File 'lib/heroku-client/api.rb', line 28

def keys
  return get("user/keys")
end

#processes(app_name) ⇒ Object



32
33
34
# File 'lib/heroku-client/api.rb', line 32

def processes(app_name)
  return get("apps/#{app_name}/ps")
end

#releases(app_name) ⇒ Object



36
37
38
# File 'lib/heroku-client/api.rb', line 36

def releases(app_name)
  return get("apps/#{app_name}/releases")
end

#stacks(app_name) ⇒ Object



40
41
42
# File 'lib/heroku-client/api.rb', line 40

def stacks(app_name)
  get "apps/#{app_name}/stack"
end