Class: Escobar::Heroku::Coupling
- Inherits:
-
Object
- Object
- Escobar::Heroku::Coupling
- Defined in:
- lib/escobar/heroku/coupling.rb
Overview
Class representing a deployable environment
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
Instance Method Summary collapse
-
#initialize(client, coupling) ⇒ Coupling
constructor
A new instance of Coupling.
- #name ⇒ Object
- #to_hash ⇒ Object
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
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/escobar/heroku/coupling.rb', line 5 def app @app end |
#app_id ⇒ Object (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 |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/escobar/heroku/coupling.rb', line 5 def client @client end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/escobar/heroku/coupling.rb', line 5 def id @id end |
#stage ⇒ Object (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
#name ⇒ Object
17 18 19 |
# File 'lib/escobar/heroku/coupling.rb', line 17 def name app && app.name end |
#to_hash ⇒ Object
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 |