123456789_123456789_123456789_123456789_123456789_

Class: RDoc::Markup::Paragraph

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Raw
Instance Chain:
self, Raw
Inherits: RDoc::Markup::Raw
Defined in: lib/rdoc/markup/paragraph.rb

Overview

A Paragraph of text

Class Method Summary

Raw - Inherited

.new

Creates a new Raw containing parts

Instance Attribute Summary

Raw - Inherited

#parts

The component parts of the list.

Instance Method Summary

Raw - Inherited

#<<

Appends #text

#accept

Calls #accept_raw+ on visitor

#merge

Appends other‘s parts.

#push

Appends texts onto this Paragraph.

#text

The raw text.

#==, #pretty_print

Constructor Details

This class inherits a constructor from RDoc::Markup::Raw

Instance Method Details

#accept(visitor)

Calls #accept_paragraph on visitor

[ GitHub ]

  
# File 'lib/rdoc/markup/paragraph.rb', line 10

def accept visitor
  visitor.accept_paragraph self
end

#text(hard_break = '')

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

[ GitHub ]

  
# File 'lib/rdoc/markup/paragraph.rb', line 18

def text hard_break = ''
  @parts.map do |part|
    if RDoc::Markup::HardBreak === part then
      hard_break
    else
      part
    end
  end.join
end