Sha256: d85f954e6bb0c7932e0f2e7379907f33a5bcb9980bea0a6986a11baab0866270

Contents?: true

Size: 862 Bytes

Versions: 23

Compression:

Stored size: 862 Bytes

Contents

require "json"

module Timber
  class CLI
    class Application

      attr_reader :api_key, :environment, :framework_type, :heroku_drain_url, :language_type,
        :name, :platform_type

      def initialize(api)
        res = api.application!
        parsed_body = JSON.parse(res.body)
        application_data = parsed_body.fetch("data")
        @api_key = application_data.fetch("api_key")
        @environment = application_data.fetch("environment")
        @framework_type = application_data.fetch("framework_type")
        @heroku_drain_url = application_data.fetch("heroku_drain_url")
        @language_type = application_data.fetch("language_type")
        @name = application_data.fetch("name")
        @platform_type = application_data.fetch("platform_type")
      end

      def heroku?
        platform_type == "heroku"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
timber-2.0.24 lib/timber/cli/application.rb
timber-2.0.23 lib/timber/cli/application.rb
timber-2.0.22 lib/timber/cli/application.rb
timber-2.0.21 lib/timber/cli/application.rb
timber-2.0.20 lib/timber/cli/application.rb
timber-2.0.19 lib/timber/cli/application.rb
timber-2.0.17 lib/timber/cli/application.rb
timber-2.0.16 lib/timber/cli/application.rb
timber-2.0.15 lib/timber/cli/application.rb
timber-2.0.14 lib/timber/cli/application.rb
timber-2.0.12 lib/timber/cli/application.rb
timber-2.0.11 lib/timber/cli/application.rb
timber-2.0.10 lib/timber/cli/application.rb
timber-2.0.9 lib/timber/cli/application.rb
timber-2.0.8 lib/timber/cli/application.rb
timber-2.0.7 lib/timber/cli/application.rb
timber-2.0.6 lib/timber/cli/application.rb
timber-2.0.5 lib/timber/cli/application.rb
timber-2.0.4 lib/timber/cli/application.rb
timber-2.0.3 lib/timber/cli/application.rb