Class: Escobar::Heroku::ConfigVars
- Inherits:
-
Object
- Object
- Escobar::Heroku::ConfigVars
- Defined in:
- lib/escobar/heroku/config_vars.rb
Overview
Class representing a heroku application’s environment variables
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Retrieve an environmental variable by name.
- #info ⇒ Object
- #info_json ⇒ Object
-
#initialize(client, app_id) ⇒ ConfigVars
constructor
A new instance of ConfigVars.
- #values ⇒ Object
Constructor Details
#initialize(client, app_id) ⇒ ConfigVars
Returns a new instance of ConfigVars.
6 7 8 9 |
# File 'lib/escobar/heroku/config_vars.rb', line 6 def initialize(client, app_id) @app_id = app_id @client = client end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
5 6 7 |
# File 'lib/escobar/heroku/config_vars.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/config_vars.rb', line 5 def client @client end |
Instance Method Details
#[](key) ⇒ Object
Retrieve an environmental variable by name
12 13 14 |
# File 'lib/escobar/heroku/config_vars.rb', line 12 def [](key) values[key] end |
#info ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/escobar/heroku/config_vars.rb', line 20 def info if info_json["id"] == "two_factor" && info_json["message"].match(/second authentication factor/) {} else info_json end end |
#info_json ⇒ Object
29 30 31 |
# File 'lib/escobar/heroku/config_vars.rb', line 29 def info_json @info_json ||= client.heroku.get("/apps/#{app_id}/config-vars") end |
#values ⇒ Object
16 17 18 |
# File 'lib/escobar/heroku/config_vars.rb', line 16 def values @info ||= info end |