Sha256: f8f640678f9deda53127170c85a28fd1ee55a625fff7912e9a5d45c5849e7c01

Contents?: true

Size: 871 Bytes

Versions: 25

Compression:

Stored size: 871 Bytes

Contents

module Timber
  class CLI
    class API
      class Application
        DEVELOPMENT_ENVIRONMENT = "development".freeze
        TEST_ENVIRONMENT = "test".freeze
        HEROKU = "heroku".freeze

        attr_accessor :api_key, :environment, :heroku_drain_url,
          :name, :platform_type

        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

        def development?
          environment == DEVELOPMENT_ENVIRONMENT
        end

        def test?
          environment == TEST_ENVIRONMENT
        end

        def heroku?
          platform_type == HEROKU
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
timber-2.6.2 lib/timber/cli/api/application.rb
timber-2.6.1 lib/timber/cli/api/application.rb
timber-2.6.0 lib/timber/cli/api/application.rb
timber-2.6.0.pre.beta2 lib/timber/cli/api/application.rb
timber-2.6.0.pre.beta1 lib/timber/cli/api/application.rb
timber-2.5.1 lib/timber/cli/api/application.rb
timber-2.5.0 lib/timber/cli/api/application.rb
timber-2.4.0 lib/timber/cli/api/application.rb
timber-2.3.4 lib/timber/cli/api/application.rb
timber-2.3.3 lib/timber/cli/api/application.rb
timber-2.3.2 lib/timber/cli/api/application.rb
timber-2.3.1 lib/timber/cli/api/application.rb
timber-2.3.0 lib/timber/cli/api/application.rb
timber-2.2.3 lib/timber/cli/api/application.rb
timber-2.2.2 lib/timber/cli/api/application.rb
timber-2.2.1 lib/timber/cli/api/application.rb
timber-2.2.0 lib/timber/cli/api/application.rb
timber-2.1.10 lib/timber/cli/api/application.rb
timber-2.1.9 lib/timber/cli/api/application.rb
timber-2.1.8 lib/timber/cli/api/application.rb