Sha256: e82300e0d2f1c518a692d9e95c07e98c94d8e283da390e6dac483a1f22b32c03

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 Bytes

Contents

module Patentscope

  class WebserviceSoapBuilder

    def build_envelope(operation, options_hash)
      builder = Nokogiri::XML::Builder.new do |xml|
        xml.Envelope do
          ns = xml.doc.root.add_namespace_definition('S', 'http://schemas.xmlsoap.org/soap/envelope/')
          xml.doc.root.namespace = ns
          xml.Body do
            xml.send(operation, :'xmlns' => 'http://www.wipo.org/wsdl/ps') do
              options_hash.each do |key, value|
                xml.send(key, value)
              end
            end
          end
        end
      end.to_xml
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
patentscope-0.0.5 lib/patentscope/webservice_soap_builder.rb
patentscope-0.0.4 lib/patentscope/webservice_soap_builder.rb