Sha256: 398fe35608cbf0641680024f78e4a7e99e2357b65c2bf60306dcc645695c8490

Contents?: true

Size: 517 Bytes

Versions: 17

Compression:

Stored size: 517 Bytes

Contents

require 'singleton'

module Biro
  class Configuration
    include Singleton

    attr_accessor :environment, :logger

    def logger
      @logger ||= Logger.new(STDOUT)
    end

    def development!
      @environment = :development
    end

    def development?
      @environment == :development
    end

    def gateway(name, options = {})
      klass_name = Biro::Utils.camelize(name.to_s) + '::Request'
      klass = Biro.const_get(klass_name)

      Biro.gateways[name] = klass.new(options)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
biro-0.7.1 lib/biro/configuration.rb
biro-0.7.0 lib/biro/configuration.rb
biro-0.6.10 lib/biro/configuration.rb
biro-0.6.9 lib/biro/configuration.rb
biro-0.6.8 lib/biro/configuration.rb
biro-0.6.7 lib/biro/configuration.rb
biro-0.6.6 lib/biro/configuration.rb
biro-0.6.5 lib/biro/configuration.rb
biro-0.6.4 lib/biro/configuration.rb
biro-0.6.3 lib/biro/configuration.rb
biro-0.6.2 lib/biro/configuration.rb
biro-0.6.1 lib/biro/configuration.rb
biro-0.5.1 lib/biro/configuration.rb
biro-0.4.1 lib/biro/configuration.rb
biro-0.4.0 lib/biro/configuration.rb
biro-0.3.0 lib/biro/configuration.rb
biro-0.2.0 lib/biro/configuration.rb