Class: Serenity::CodeLine
Direct Known Subclasses
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_code(code) ⇒ Object
46 47 48 |
# File 'lib/serenity/serenity/line.rb', line 46 def escape_code code code.mgsub! [[/'/, "'"], [/>/, '>'], [/</, '<'], [/"/, '"'], [/&/, '&']] end |
#to_buf ⇒ Object
42 43 44 |
# File 'lib/serenity/serenity/line.rb', line 42 def to_buf escape_code(@text) << ';' end |