Class: Gyoku::Array

Inherits:
Object
  • Object
show all
Defined in:
lib/gyoku/array.rb

Constant Summary collapse

NESTED_ELEMENT_NAME =
"element"

Class Method Summary collapse

Class Method Details

.to_xml(array, key, escape_xml = true, attributes = {}, options = {}) ⇒ Object

Builds XML and prettifies it if pretty_print option is set to true


13
14
15
16
17
18
19
20
21
# File 'lib/gyoku/array.rb', line 13

def self.to_xml(array, key, escape_xml = true, attributes = {}, options = {})
  xml = build_xml(array, key, escape_xml, attributes, options)

  if options[:pretty_print] && options[:unwrap]
    Prettifier.prettify(xml, options)
  else
    xml
  end
end