Class: Timber::CLI::API::Application
- Inherits:
-
Object
- Object
- Timber::CLI::API::Application
- Defined in:
- lib/timber/cli/api/application.rb
Constant Summary collapse
- DEVELOPMENT_ENVIRONMENT =
"development".freeze
- TEST_ENVIRONMENT =
"test".freeze
- HEROKU =
"heroku".freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#heroku_drain_url ⇒ Object
Returns the value of attribute heroku_drain_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#platform_type ⇒ Object
Returns the value of attribute platform_type.
Instance Method Summary collapse
- #development? ⇒ Boolean
- #heroku? ⇒ Boolean
-
#initialize(attributes) ⇒ Application
constructor
A new instance of Application.
- #test? ⇒ Boolean
Constructor Details
#initialize(attributes) ⇒ Application
Returns a new instance of Application.
12 13 14 15 16 17 18 |
# File 'lib/timber/cli/api/application.rb', line 12 def initialize(attributes) @api_key = attributes.fetch("api_key") @environment = attributes.fetch("environment") @heroku_drain_url = attributes.fetch("heroku_drain_url") @name = attributes.fetch("name") @platform_type = attributes.fetch("platform_type") end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/timber/cli/api/application.rb', line 9 def api_key @api_key end |
#environment ⇒ Object
Returns the value of attribute environment.
9 10 11 |
# File 'lib/timber/cli/api/application.rb', line 9 def environment @environment end |
#heroku_drain_url ⇒ Object
Returns the value of attribute heroku_drain_url.
9 10 11 |
# File 'lib/timber/cli/api/application.rb', line 9 def heroku_drain_url @heroku_drain_url end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/timber/cli/api/application.rb', line 9 def name @name end |
#platform_type ⇒ Object
Returns the value of attribute platform_type.
9 10 11 |
# File 'lib/timber/cli/api/application.rb', line 9 def platform_type @platform_type end |
Instance Method Details
#development? ⇒ Boolean
20 21 22 |
# File 'lib/timber/cli/api/application.rb', line 20 def development? environment == DEVELOPMENT_ENVIRONMENT end |
#heroku? ⇒ Boolean
28 29 30 |
# File 'lib/timber/cli/api/application.rb', line 28 def heroku? platform_type == HEROKU end |
#test? ⇒ Boolean
24 25 26 |
# File 'lib/timber/cli/api/application.rb', line 24 def test? environment == TEST_ENVIRONMENT end |