Sha256: 376f983bb322b73e264ff19efc6689ab046318566115150ce0caf68f45ed8873

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

require_relative 'version'

module Postmates
  module Configuration

    VALID_CONFIGURATION_KEYS = [:headers, :api_url, :api_key,
                                :customer_id, :raw_response]

    attr_accessor *VALID_CONFIGURATION_KEYS

    DEFAULT_API_URL = 'https://api.postmates.com/v1/'
    DEFAULT_HEADERS = {
                        accept: 'application/json',
                        user_agent: "postmates gem #{Postmates::Version}"
                      }

    def configure
      yield self
    end

    def reset
      self.headers      = DEFAULT_HEADERS
      self.api_url      = DEFAULT_API_URL
      self.api_key      = nil
      self.customer_id  = nil
      self.raw_response = false
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
postmates-0.1.0 lib/postmates/configuration.rb