Sha256: fd8d804e8c86c77302da07f04a3b32e9884343b079cd7b32f239f1ecfae2a0e8

Contents?: true

Size: 680 Bytes

Versions: 11

Compression:

Stored size: 680 Bytes

Contents

module Asaas
  module Configuration

    mattr_accessor :staging_endpoint do
      'http://homolog.asaas.com/api/v2'
    end

    mattr_accessor :production_endpoint do
      'https://www.asaas.com/api/v2'
    end

    mattr_accessor :production do
      false
    end

    mattr_accessor :token

    class << self

      def setup(&block)
        yield self if block_given?
        self
      end

      def get_endpoint
        if production
          production_endpoint
        else
          staging_endpoint
        end
      end

      def get_environment
        if production
          :production
        else
          :staging
        end
      end

    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
asaas-ruby-0.1.10 lib/asaas/configuration.rb
asaas-ruby-0.1.9 lib/asaas/configuration.rb
asaas-ruby-0.1.8 lib/asaas/configuration.rb
asaas-ruby-0.1.7 lib/asaas/configuration.rb
asaas-ruby-0.1.6 lib/asaas/configuration.rb
asaas-ruby-0.1.5 lib/asaas/configuration.rb
asaas-ruby-0.1.4 lib/asaas/configuration.rb
asaas-ruby-0.1.3 lib/asaas/configuration.rb
asaas-ruby-0.1.2 lib/asaas/configuration.rb
asaas-ruby-0.1.1 lib/asaas/configuration.rb
asaas-ruby-0.1.0 lib/asaas/configuration.rb