Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/active_record/remote/core_ext/hash.rb
Instance Method Summary collapse
Instance Method Details
#build_internal_xml(options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/active_record/remote/core_ext/hash.rb', line 26 def build_internal_xml( = {}) [:builder] ||= Builder::XmlMarkup.new(indent: 0) builder = [:builder] root = ActiveSupport::XmlMini.rename_key([:root].to_s, ) builder.tag!(root) do each { |key, value| ActiveSupport::XmlMini.to_tag(key, value, ) } yield builder if block_given? end builder.target! end |
#to_soap(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/active_record/remote/core_ext/hash.rb', line 3 def to_soap( = {}) require 'active_support/builder' unless defined?(Builder) = .dup [:indent] ||= 2 [:root] ||= 'hash' [:soap_builder] ||= Builder::XmlMarkup.new(indent: [:indent]) soap_builder = [:soap_builder] soap_builder.Envelope xmlns: "http://schemas.xmlsoap.org/soap/envelope/" do soap_builder.Body do soap_builder.tag!([:operation], xmlns: [:namespace]) do soap_builder.tag!([:base_element], "\n#{build_internal_xml(options)}") end end end end |