Class: Pump::Xml::TagArray
Instance Attribute Summary
Attributes inherited from Node
#attributes, #name, #nodes, #options
Instance Method Summary collapse
-
#initialize(name, attributes = {}, nodes = [], options = {}) ⇒ TagArray
constructor
A new instance of TagArray.
- #to_s ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(name, attributes = {}, nodes = [], options = {}) ⇒ TagArray
Returns a new instance of TagArray.
7 8 9 10 11 12 13 14 |
# File 'lib/pump/xml/tag_array.rb', line 7 def initialize(name, attributes={}, nodes=[], ={}) tag = Tag.new(name, attributes, nodes, { :level => 1, :extra_indent => [:extra_indent], :xml_key_style => [:xml_key_style] }) array_root = [:array_root] || name.to_s.pluralize super(array_root, {}, [tag], ) end |
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/pump/xml/tag_array.rb', line 16 def to_s if .has_key?(:static_value) "#{prefix}<#{format_name name} type=\\\"array\\\"#{static_value_and_close_tag}" else "#{prefix}<#{format_name name} type=\\\"array\\\"#{loop_and_close_tag}" end end |