class Escobar::Heroku::ConfigVars

Class representing a heroku application's environment variables

Attributes

app_id[R]
client[R]

Public Class Methods

new(client, app_id) click to toggle source
# File lib/escobar/heroku/config_vars.rb, line 6
def initialize(client, app_id)
  @app_id = app_id
  @client = client
end

Public Instance Methods

[](key) click to toggle source

Retrieve an environmental variable by name

# File lib/escobar/heroku/config_vars.rb, line 12
def [](key)
  values[key]
end
info() click to toggle source
# 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() click to toggle source
# File lib/escobar/heroku/config_vars.rb, line 29
def info_json
  @info_json ||= client.heroku.get("/apps/#{app_id}/config-vars")
end
values() click to toggle source
# File lib/escobar/heroku/config_vars.rb, line 16
def values
  @info ||= info
end