Class: Timber::CLI::API::Application

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_keyObject

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

#environmentObject

Returns the value of attribute environment.



9
10
11
# File 'lib/timber/cli/api/application.rb', line 9

def environment
  @environment
end

#heroku_drain_urlObject

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

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/timber/cli/api/application.rb', line 9

def name
  @name
end

#platform_typeObject

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

Returns:

  • (Boolean)


20
21
22
# File 'lib/timber/cli/api/application.rb', line 20

def development?
  environment == DEVELOPMENT_ENVIRONMENT
end

#heroku?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/timber/cli/api/application.rb', line 28

def heroku?
  platform_type == HEROKU
end

#test?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/timber/cli/api/application.rb', line 24

def test?
  environment == TEST_ENVIRONMENT
end