Class: Aws::Xml::DocBuilder Private
- Inherits:
-
Object
- Object
- Aws::Xml::DocBuilder
- Defined in:
- lib/aws-sdk-core/xml/doc_builder.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #target ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ DocBuilder
constructor
private
A new instance of DocBuilder.
- #node(name, *args, &block) ⇒ void private
Constructor Details
#initialize(options = {}) ⇒ DocBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DocBuilder.
8 9 10 11 12 13 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 8 def initialize( = {}) @target = [:target] || '' @indent = [:indent] || '' @pad = [:pad] || '' @end_of_line = @indent == '' ? '' : "\n" end |
Instance Attribute Details
#target ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 15 def target @target end |
Instance Method Details
#node(name, attributes = {}) ⇒ void #node(name, value, attributes = {}) ⇒ void #node(name, attributes = {}, &block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 30 def node(name, *args, &block) attrs = args.last.is_a?(Hash) ? args.pop : {} if block_given? @target << open_el(name, attrs) @target << @end_of_line increase_pad { yield } @target << @pad @target << close_el(name) elsif args.empty? @target << empty_element(name, attrs) else @target << inline_element(name, args.first, attrs) end end |