private Method

Format.__paragraphs(to_wrap)

format lines in text into paragraphs with each element of @wrap a paragraph; uses Text::Format.format for the formatting

Source Code

# File action_mailer/vendor/text-format-0.6.3/text/format.rb, line 659
def __paragraphs(to_wrap) #:nodoc:
  if ((@first_indent == @body_indent) || @tag_paragraph) then
    p_end = "\n"
  else
    p_end = ''
  end

  cnt = 0
  ret = []
  to_wrap.each do |tw|
    @tag_cur = @tag_text[cnt] if @tag_paragraph
    @tag_cur = '' if @tag_cur.nil?
    line = __format(tw)
    ret << "#{line}#{p_end}" if (not line.nil?) && (line.size > 0)
    cnt += 1
  end

  ret[-1].chomp! unless ret.empty?
  ret.join('')
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.