Sha256: ff9ecbf123f6a72a044372a30f8f483dfa916398dfb13e1e3f87232639b0cea7

Contents?: true

Size: 880 Bytes

Versions: 4

Compression:

Stored size: 880 Bytes

Contents

require "savon/logger"
require "savon/null_logger"
require "savon/hooks/group"
require "savon/soap"

module Savon
  Config = Struct.new(:_logger, :pretty_print_xml, :raise_errors, :soap_version, :env_namespace, :soap_header) do

    def self.default
      config = new
      config._logger = Logger.new
      config.raise_errors = true
      config.soap_version = SOAP::DEFAULT_VERSION
      config
    end

    alias_method :logger, :_logger

    def logger=(logger)
      _logger.subject = logger
    end

    def log_level=(level)
      _logger.level = level
    end

    def log=(log)
      if log == true
        self._logger = Logger.new
      else
        self._logger = NullLogger.new
      end
    end

    def hooks
      @hooks ||= Hooks::Group.new
    end

    def clone
      config = super
      config._logger = config._logger.clone
      config
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
savon-1.2.0 lib/savon/config.rb
savon-1.1.0 lib/savon/config.rb
savon-1.0.0 lib/savon/config.rb
savon-0.9.14 lib/savon/config.rb