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.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 10 def initialize( = {}) @target = [:target] || ( # The String has to be mutable # because @target implements `<<` method. String.new ) @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.
21 22 23 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 21 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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/aws-sdk-core/xml/doc_builder.rb', line 36 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(&block) @target << @pad @target << close_el(name) elsif args.empty? @target << empty_element(name, attrs) else @target << inline_element(name, args.first, attrs) end end |