Class: RDoc::Markup::Raw

Inherits:
Object show all
Defined in:
lib/rdoc/markup/raw.rb

Overview

A section of text that is added to the output document as-is

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Raw) initialize(*parts)

Creates a new Raw containing parts



14
15
16
17
# File 'lib/rdoc/markup/raw.rb', line 14

def initialize *parts
  @parts = []
  @parts.push(*parts)
end

Instance Attribute Details

- (Object) parts (readonly)

The component parts of the list



9
10
11
# File 'lib/rdoc/markup/raw.rb', line 9

def parts
  @parts
end

Instance Method Details

- (Object) <<(text)

Appends text



22
23
24
# File 'lib/rdoc/markup/raw.rb', line 22

def << text
  @parts << text
end

- (Object) ==(other)

:nodoc:



26
27
28
# File 'lib/rdoc/markup/raw.rb', line 26

def == other # :nodoc:
  self.class == other.class and text == other.text
end

- (Object) accept(visitor)

Calls #accept_raw+ on visitor



33
34
35
# File 'lib/rdoc/markup/raw.rb', line 33

def accept visitor
  visitor.accept_raw self
end

- (Object) merge(other)

Appends other's parts



40
41
42
# File 'lib/rdoc/markup/raw.rb', line 40

def merge other
  @parts.push(*other.parts)
end

- (Object) pretty_print(q)

:nodoc:



44
45
46
47
48
49
50
51
52
# File 'lib/rdoc/markup/raw.rb', line 44

def pretty_print q # :nodoc:
  self.class.name =~ /.*::(\w{4})/i

  q.group 2, "[#{$1.downcase}: ", ']' do
    q.seplist @parts do |part|
      q.pp part
    end
  end
end

- (Object) push(*texts)

Appends texts onto this Paragraph



57
58
59
# File 'lib/rdoc/markup/raw.rb', line 57

def push *texts
  self.parts.push(*texts)
end

- (Object) text

The raw text



64
65
66
# File 'lib/rdoc/markup/raw.rb', line 64

def text
  @parts.join ' '
end