Class: StatSailr::Output::OutputNode
- Inherits:
-
Object
- Object
- StatSailr::Output::OutputNode
- Extended by:
- Forwardable
- Defined in:
- lib/statsailr/sts_output/output_manager.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #each_message(&blk) ⇒ Object
- #each_node(&blk) ⇒ Object
-
#initialize(tag, parent) ⇒ OutputNode
constructor
A new instance of OutputNode.
- #new_message(type, content) ⇒ Object
- #new_node(tag) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(tag, parent) ⇒ OutputNode
Returns a new instance of OutputNode.
69 70 71 72 73 74 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 69 def initialize(tag , parent) @tag = tag @children = [] @parent = parent = [] end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
68 69 70 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 68 def end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
68 69 70 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 68 def parent @parent end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
68 69 70 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 68 def tag @tag end |
Instance Method Details
#each_message(&blk) ⇒ Object
90 91 92 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 90 def (&blk) .each(&blk) end |
#each_node(&blk) ⇒ Object
86 87 88 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 86 def each_node(&blk) @children.each(&blk) end |
#new_message(type, content) ⇒ Object
81 82 83 84 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 81 def ( type, content ) << OutputMessage.new(type, content, self ) return .last end |
#new_node(tag) ⇒ Object
76 77 78 79 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 76 def new_node(tag) @children << OutputNode.new(tag, self) return @children.last end |
#to_s ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/statsailr/sts_output/output_manager.rb', line 94 def to_s() str = "" if ! .empty? (){|| str << .to_s() } end if ! @children.empty? each_node(){|node| str << node.to_s() } end return str end |