Class: Escobar::Heroku::Coupling

Inherits:
Object
  • Object
show all
Defined in:
lib/escobar/heroku/coupling.rb

Overview

Class representing a deployable environment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, coupling) ⇒ Coupling

Returns a new instance of Coupling.



6
7
8
9
10
11
# File 'lib/escobar/heroku/coupling.rb', line 6

def initialize(client, coupling)
  @id     = coupling["id"]
  @stage  = coupling["stage"]
  @app_id = coupling["app"]["id"]
  @client = client
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/escobar/heroku/coupling.rb', line 5

def app
  @app
end

#app_idObject (readonly)

Returns the value of attribute app_id.



5
6
7
# File 'lib/escobar/heroku/coupling.rb', line 5

def app_id
  @app_id
end

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/escobar/heroku/coupling.rb', line 5

def client
  @client
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/escobar/heroku/coupling.rb', line 5

def id
  @id
end

#stageObject (readonly)

Returns the value of attribute stage.



5
6
7
# File 'lib/escobar/heroku/coupling.rb', line 5

def stage
  @stage
end

Instance Method Details

#nameObject



17
18
19
# File 'lib/escobar/heroku/coupling.rb', line 17

def name
  app && app.name
end

#to_hashObject



21
22
23
24
25
26
27
28
# File 'lib/escobar/heroku/coupling.rb', line 21

def to_hash
  {
    id: id,
    name: name,
    stage: stage,
    app_id: app_id
  }
end