Class: Dawn::App::Env

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseApi

included, #to_h

Methods included from BaseApi::RequestExtension

#request

Methods included from SafeExtension

#safe

Constructor Details

#initialize(app, data) ⇒ Env

Returns a new instance of Env.

Parameters:



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

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

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



14
15
16
# File 'lib/dawn/api/models/app/env.rb', line 14

def app
  @app
end

Instance Method Details

#refresh(options = {}) ⇒ Object

Parameters:

  • options (Hash) (defaults to: {})


29
30
31
32
33
34
# File 'lib/dawn/api/models/app/env.rb', line 29

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

#save(options = {}) ⇒ Object

Parameters:

  • options (Hash) (defaults to: {})


39
40
41
42
43
44
# File 'lib/dawn/api/models/app/env.rb', line 39

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