Class: Kwaff::Text

Inherits:
Node
  • Object
show all
Defined in:
lib/kwaff/node.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#empty_lines

Instance Method Summary collapse

Methods inherited from Node

#to_rexml, #to_xml

Constructor Details

#initialize(str, flag_escape = true) ⇒ Text

Returns a new instance of Text.



88
89
90
91
# File 'lib/kwaff/node.rb', line 88

def initialize(str, flag_escape=true)
   @str = str
   @escape = flag_escape
end

Instance Attribute Details

#escapeObject

Returns the value of attribute escape.



92
93
94
# File 'lib/kwaff/node.rb', line 92

def escape
  @escape
end

#strObject

Returns the value of attribute str.



92
93
94
# File 'lib/kwaff/node.rb', line 92

def str
  @str
end

Instance Method Details

#accept(translator, level = 0) ⇒ Object



85
86
87
# File 'lib/kwaff/node.rb', line 85

def accept(translator, level=0)
   return translator.translate_text(self, level)
end

#escape?Boolean

def str

return @escape ? Kwaff::escape(@str) : @str

end

Returns:

  • (Boolean)


96
97
98
# File 'lib/kwaff/node.rb', line 96

def escape?
   return @escape
end