Sha256: 20fbe27206401288cb91421dba7d512301c0136fe8e6d692fde51dc60f5eb589
Contents?: true
Size: 1018 Bytes
Versions: 8
Compression:
Stored size: 1018 Bytes
Contents
require "wasabi" require "httpi/request" module Savon module Wasabi # = Savon::Wasabi::Document # # Extends the document handling of the <tt>Wasabi::Document</tt> by # adding support for remote and local WSDL documents. class Document < ::Wasabi::Document # Hooks into Wasabi and extends its document handling. def xml @xml ||= document.kind_of?(String) ? resolve_document : document end # Sets the <tt>HTTPI::Request</tt> for remote WSDL documents. attr_writer :request private # Sets up and returns the <tt>HTTPI::Request</tt>. def request @request ||= HTTPI::Request.new @request.url = document @request end # Resolves and returns the raw WSDL document. def resolve_document case document when /^http[s]?:/ then HTTPI.get(request).body when /^</ then document else File.read(document) end end end end end
Version data entries
8 entries across 8 versions & 4 rubygems