Sha256: 4638b925838faeb78ea23f7776e5c698210fdcdf78ed63b39b5a42fd997291be

Contents?: true

Size: 937 Bytes

Versions: 2

Compression:

Stored size: 937 Bytes

Contents

require 'logger'

module Shutl::Resource
  class << self
    attr_writer :raise_exceptions_on_validation,
                :raise_exceptions_on_no_quotes_generated

    def raise_exceptions_on_validation
      if @raise_exceptions_on_validation.nil?
        @raise_exceptions_on_validation = false
      end

      @raise_exceptions_on_validation
    end

    def raise_exceptions_on_no_quotes_generated
      if @raise_exceptions_on_no_quotes_generated.nil?
        @raise_exceptions_on_no_quotes_generated = true
      end

      @raise_exceptions_on_no_quotes_generated
    end
  end

  def configure(*args, &block)
    Configuration.configure(*args, &block)
  end

  module Configuration
    class << self
      attr_accessor :base_uri

      def configure
        yield self
      end

      def logger
        @logger ||= Logger.new($stdout)
      end

      def logger=(logger)
        @logger = logger
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shutl_resource-1.0.0 lib/shutl/resource/configuration.rb
shutl_resource-0.10.6 lib/shutl/resource/configuration.rb