Support for the Ruby 2.1 series ended on March 31 2017. See here for details.

In Files

  • rdoc/markup/indented_paragraph.rb

Class/Module Index [+]

Quicksearch

RDoc::Markup::IndentedParagraph

An Indented Paragraph of text

Attributes

indent[R]

The indent in number of spaces

Public Class Methods

new(indent, *parts) click to toggle source

Creates a new IndentedParagraph containing parts indented with indent spaces

 
               # File rdoc/markup/indented_paragraph.rb, line 15
def initialize indent, *parts
  @indent = indent

  super(*parts)
end
            

Public Instance Methods

accept(visitor) click to toggle source

Calls accept_indented_paragraph on visitor

 
               # File rdoc/markup/indented_paragraph.rb, line 28
def accept visitor
  visitor.accept_indented_paragraph self
end
            
text(hard_break = nil) click to toggle source

Joins the raw paragraph text and converts inline HardBreaks to the hard_break text followed by the indent.

 
               # File rdoc/markup/indented_paragraph.rb, line 36
def text hard_break = nil
  @parts.map do |part|
    if RDoc::Markup::HardBreak === part then
      '%1$s%3$*2$s' % [hard_break, @indent, ' '] if hard_break
    else
      part
    end
  end.join
end