Class: Text
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from Node
#children, #level, #name, #parent
Instance Method Summary collapse
- #append(t) ⇒ Object
-
#initialize ⇒ Text
constructor
A new instance of Text.
- #to_s ⇒ Object
Methods inherited from Node
#add_child, #all_children, #print, #print_children, #root, #root?
Constructor Details
#initialize ⇒ Text
Returns a new instance of Text.
187 188 189 190 |
# File 'lib/rest.rb', line 187 def initialize @text = Array.new super() end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
185 186 187 |
# File 'lib/rest.rb', line 185 def text @text end |
Instance Method Details
#append(t) ⇒ Object
196 197 198 |
# File 'lib/rest.rb', line 196 def append t @text.push t end |
#to_s ⇒ Object
192 193 194 |
# File 'lib/rest.rb', line 192 def to_s @text.join("\n") end |