Class: Text

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

Instance Attribute Summary

Attributes inherited from Node

#tmp

Instance Method Summary collapse

Methods inherited from Node

#add_on_tree, #depth, #id, #id=

Constructor Details

#initialize(depth, text) ⇒ Text

Returns a new instance of Text.



93
94
95
96
# File 'lib/rdnode.rb', line 93

def initialize(depth, text)
  super(depth)
  @text = text
end

Instance Method Details

#to_csvObject



102
103
104
# File 'lib/rdnode.rb', line 102

def to_csv
  @text
end

#to_descObject



106
107
108
# File 'lib/rdnode.rb', line 106

def to_desc
  @text
end

#to_rdObject



110
111
112
# File 'lib/rdnode.rb', line 110

def to_rd
  "#{dashes(depth)} #{@text}"
end

#to_sObject



98
99
100
# File 'lib/rdnode.rb', line 98

def to_s
  "(Text depth:#{depth}, text:#{@text}, tmp:#{@tmp})"
end