Class: RDoc::Markup::Paragraph

Inherits:
Raw
  • Object
show all
Defined in:
lib/rdoc/markup/paragraph.rb

Overview

A Paragraph of text

Instance Attribute Summary

Attributes inherited from Raw

#parts

Instance Method Summary collapse

Methods inherited from Raw

#<<, #==, #initialize, #merge, #pretty_print, #push

Constructor Details

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

Instance Method Details

#accept(visitor) ⇒ Object

Calls #accept_paragraph on visitor



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

def accept visitor
  visitor.accept_paragraph self
end

#text(hard_break = '') ⇒ Object

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



18
19
20
21
22
23
24
25
26
# 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