Class: Dawn::App::Env

Inherits:
Hash
  • Object
show all
Includes:
BaseApi
Defined in:
lib/dawn/api/app/env.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseApi

included

Methods included from BaseApi::Extension

#json_request, #request

Constructor Details

#initialize(app, data) ⇒ Env

Returns a new instance of Env.



11
12
13
14
15
# File 'lib/dawn/api/app/env.rb', line 11

def initialize(app, data)
  @app = app
  super()
  replace(data)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



9
10
11
# File 'lib/dawn/api/app/env.rb', line 9

def app
  @app
end

Instance Method Details

#refresh(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/dawn/api/app/env.rb', line 17

def refresh(options={})
  replace json_request(
    expects: 200,
    method: :get,
    path: "/apps/#{app.id}/env",
    query: options
  )["env"]
end

#save(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/dawn/api/app/env.rb', line 26

def save(options={})
  replace json_request(
    expects: 200,
    method: :post,
    path: "/apps/#{app.id}/env",
    body: { env: merge(options) }.to_json
  )["env"]
end