Class: Serenity::TextLine
Instance Attribute Summary
Attributes inherited from Line
Instance Method Summary collapse
Methods inherited from Line
code, #initialize, literal, string, text, #to_s
Constructor Details
This class inherits a constructor from Serenity::Line
Instance Method Details
#escape_text(text) ⇒ Object
36 37 38 |
# File 'lib/serenity/serenity/line.rb', line 36 def escape_text text text.gsub(/['\\]/, '\\\\\&') end |
#to_buf ⇒ Object
32 33 34 |
# File 'lib/serenity/serenity/line.rb', line 32 def to_buf " _buf << '" << escape_text(@text) << "';" end |