lib/savon.rb in savon-1.2.0 vs lib/savon.rb in savon-2.0.0

- old
+ new

@@ -1,23 +1,25 @@ -require "savon/version" -require "savon/config" -require "savon/client" -require "savon/model" - module Savon - extend self - def client(*args, &block) - Client.new(*args, &block) + class Error < RuntimeError; end + class InitializationError < Error; end + class InvalidResponseError < Error; end + + def self.client(globals = {}, &block) + Client.new(globals, &block) end - def configure - yield config + def self.observers + @observers ||= [] end - def config - @config ||= Config.default + def self.notify_observers(operation_name, builder, globals, locals) + observers.inject(nil) do |response, observer| + observer.notify(operation_name, builder, globals, locals) + end end - attr_writer :config - end + +require "savon/version" +require "savon/client" +require "savon/model"