Class: Serenity::StringLine

Inherits:
CodeLine show all
Defined in:
lib/serenity/line.rb

Instance Attribute Summary

Attributes inherited from Line

#text

Instance Method Summary collapse

Methods inherited from CodeLine

#escape_code

Methods inherited from Line

code, #initialize, literal, string, text, #to_s

Constructor Details

This class inherits a constructor from Serenity::Line

Instance Method Details

#convert_newlines(text) ⇒ Object



56
57
58
# File 'lib/serenity/line.rb', line 56

def convert_newlines text
  text.gsub("First line", '<text:line-break>')
end

#to_bufObject



52
53
54
# File 'lib/serenity/line.rb', line 52

def to_buf
  " _buf << (" << escape_code(@text) << ").to_s.escape_xml.convert_newlines;"
end