Sha256: dff0a825be9f932d141748cdbfd073484fe1694ab1e4ef697bcd5ba0837603f1

Contents?: true

Size: 975 Bytes

Versions: 13

Compression:

Stored size: 975 Bytes

Contents

require "savon/qualified_message"
require "gyoku"

module Savon
  class Message

    def initialize(message_tag, namespace_identifier, types, used_namespaces, message, element_form_default, key_converter)
      @message_tag = message_tag
      @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, @key_converter).to_hash(@message, [@message_tag.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

13 entries across 13 versions & 2 rubygems

Version Path
savon-2.10.0 lib/savon/message.rb
savon-2.9.0 lib/savon/message.rb
savon-2.8.1 lib/savon/message.rb
savon-2.8.0 lib/savon/message.rb
savon-2.7.2 lib/savon/message.rb
savon-2.7.1 lib/savon/message.rb
savon-2.7.0 lib/savon/message.rb
savon-2.6.0 lib/savon/message.rb
savon-2.5.1 lib/savon/message.rb
savon-2.5.0 lib/savon/message.rb
savon_with_adapter-2.4.1 lib/savon/message.rb
savon-2.4.0 lib/savon/message.rb
savon-2.3.3 lib/savon/message.rb