class Gopher::TextContext
Attributes
result[RW]
Public Class Methods
new()
click to toggle source
# File lib/gopher.rb, line 184 def initialize @result = "" end
Public Instance Methods
line(text)
click to toggle source
# File lib/gopher.rb, line 169 def line(text) result << text result << "\r\n" end
paragraph(txt, width=70)
click to toggle source
# File lib/gopher.rb, line 178 def paragraph(txt, width=70) txt.each_line do |line| WordWrap.ww(line, width).each_line { |chunk| text chunk.strip } end end
text(text)
click to toggle source
# File lib/gopher.rb, line 174 def text(text) line text end