class Object
Public Instance Methods
indent(n, text)
click to toggle source
# File lib/bbiff/res_format.rb, line 26 def indent(n, text) text.each_line.map { |line| n.en + line }.join end
render_body(body)
click to toggle source
# File lib/bbiff/res_format.rb, line 30 def render_body(body) unescaped = CGI.unescapeHTML(body.gsub(/<br>/i, "\n")) indent(4, unescaped) + "\n" end
render_name(name, email)
click to toggle source
# File lib/bbiff/res_format.rb, line 14 def render_name(name, email) if email.empty? name else name end end
render_post(post)
click to toggle source
# File lib/bbiff/res_format.rb, line 35 def render_post(post) "#{render_resno post.no}:#{render_name post.name, post.mail}:#{post.date}\n" \ "#{render_body post.body}" end
render_resno(no)
click to toggle source
# File lib/bbiff/res_format.rb, line 22 def render_resno(no) no.to_s end