class Pebbles::TotsuGen::Formatter

Public Class Methods

new(body) click to toggle source
# File lib/pebbles/totsugen/formatters.rb, line 7
def initialize(body)
  @body = body
end

Public Instance Methods

result() click to toggle source
# File lib/pebbles/totsugen/formatters.rb, line 11
def result
  "#{header}\n#{center}\n#{footer}"
end

Private Instance Methods

body_length() click to toggle source
# File lib/pebbles/totsugen/formatters.rb, line 17
def body_length
  @body.each_char.sum { |char| (char.bytesize == 1) ? 1 : 2 }
end
header() click to toggle source
# File lib/pebbles/totsugen/formatters.rb, line 21
def header
  "_#{body_top}_"
end