Class: Escobar::Client
- Inherits:
-
Object
- Object
- Escobar::Client
- Defined in:
- lib/escobar/client.rb
Overview
Top-level client for heroku
Defined Under Namespace
Classes: HTTPError, TimeoutError
Instance Attribute Summary collapse
-
#github_token ⇒ Object
readonly
Returns the value of attribute github_token.
-
#heroku ⇒ Object
readonly
Returns the value of attribute heroku.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #app_names ⇒ Object
-
#initialize(github_token, heroku_token) ⇒ Client
constructor
A new instance of Client.
-
#inspect ⇒ Object
mask password.
- #pipelines ⇒ Object
Constructor Details
Instance Attribute Details
#github_token ⇒ Object (readonly)
Returns the value of attribute github_token.
36 37 38 |
# File 'lib/escobar/client.rb', line 36 def github_token @github_token end |
#heroku ⇒ Object (readonly)
Returns the value of attribute heroku.
36 37 38 |
# File 'lib/escobar/client.rb', line 36 def heroku @heroku end |
Class Method Details
.from_environment ⇒ Object
32 33 34 |
# File 'lib/escobar/client.rb', line 32 def self.from_environment new(Escobar.github_api_token, Escobar.heroku_api_token) end |
Instance Method Details
#[](key) ⇒ Object
49 50 51 |
# File 'lib/escobar/client.rb', line 49 def [](key) pipelines.find { |pipeline| pipeline.name == key } end |
#app_names ⇒ Object
53 54 55 |
# File 'lib/escobar/client.rb', line 53 def app_names pipelines.map(&:name) end |
#inspect ⇒ Object
mask password
43 44 45 46 47 |
# File 'lib/escobar/client.rb', line 43 def inspect inspected = super inspected = inspected.gsub! @github_token, "*******" if @github_token inspected end |