Sha256: 9da2d4884406acb17de20c2a1c3ebeace2db3d58e0e2e6579822208a36c29ca8

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

require 'platform-api'

# A wrapper for the Heroku Platform API gem.
module Dynosaur
  module Client
    module HerokuClient
      def self.config
        @config ||= Config.new
      end

      def self.configure
        yield config if block_given?
      end

      def self.client
        PlatformAPI.connect_oauth(api_key)
      end

      def self.app_name
        config.app_name || fail('app_name must be set in the config')
      end

      def self.api_key
        config.api_key || fail('api_key must be set in the config')
      end

      private

      Config = Struct.new(:api_key, :app_name)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dynosaur-0.3.1 lib/dynosaur/client/heroku_client.rb
dynosaur-0.3.0 lib/dynosaur/client/heroku_client.rb
dynosaur-0.2.1 lib/dynosaur/client/heroku_client.rb
dynosaur-0.2.0 lib/dynosaur/client/heroku_client.rb
dynosaur-0.1.0 lib/dynosaur/client/heroku_client.rb