Class: Seahorse::Client::Xml::Builder::XmlDoc Private
- Inherits:
-
Object
- Object
- Seahorse::Client::Xml::Builder::XmlDoc
- Defined in:
- lib/seahorse/client/xml/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 = {}) ⇒ XmlDoc
constructor
private
A new instance of XmlDoc.
- #node(name, *args, &block) ⇒ void private
Constructor Details
#initialize(options = {}) ⇒ XmlDoc
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 XmlDoc.
11 12 13 14 15 16 |
# File 'lib/seahorse/client/xml/builder.rb', line 11 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.
18 19 20 |
# File 'lib/seahorse/client/xml/builder.rb', line 18 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.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/seahorse/client/xml/builder.rb', line 33 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 |