Class: Text

Inherits:
Node show all
Defined in:
lib/rest.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #level, #name, #parent

Instance Method Summary collapse

Methods inherited from Node

#add_child, #all_children, #print, #print_children, #root, #root?

Constructor Details

#initializeText

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

#textObject

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_sObject



192
193
194
# File 'lib/rest.rb', line 192

def to_s
  @text.join("\n")
end