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 : (*String) -> void.

Instance Attribute Summary

Raw - Inherited

#parts

The component parts of the list : Array.

Instance Method Summary

Raw - Inherited

#<<

Appends #text : (String) -> void.

#accept

Calls #accept_raw+ on visitor : (untyped) -> void.

#merge

Appends other‘s parts : (Raw) -> void.

#push

Appends texts onto this Paragraph : (*String) -> void.

#text

The raw text : () -> String.

#==

: (top) -> bool.

#pretty_print

: (PP) -> void.

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