Sha256: 837d6319c2f5c3852439194b0c7fd2373d4176e21b01e18f31a8aff350f0ab7d

Contents?: true

Size: 995 Bytes

Versions: 1

Compression:

Stored size: 995 Bytes

Contents

require "savon/qualified_message"
require "gyoku"

module Savon
  class Message

    def initialize(operation_name, namespace_identifier, types, used_namespaces, message, element_form_default, key_converter)
      @operation_name = operation_name
      @namespace_identifier = namespace_identifier
      @types = types
      @used_namespaces = used_namespaces

      @message = message
      @element_form_default = element_form_default
      @key_converter = key_converter
    end

    def to_s
      return @message.to_s unless @message.kind_of? Hash

      if @element_form_default == :qualified
        @message = QualifiedMessage.new(@types, @used_namespaces, @request_key_converter).to_hash(@message, [@operation_name.to_s])
      end

      gyoku_options = {
        :element_form_default => @element_form_default,
        :namespace            => @namespace_identifier,
        :key_converter        => @key_converter
      }

      Gyoku.xml(@message, gyoku_options)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
savon-2.0.0 lib/savon/message.rb