123456789_123456789_123456789_123456789_123456789_

Class: RDoc::Markup::Raw

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: lib/rdoc/markup/raw.rb

Overview

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

Class Method Summary

Instance Attribute Summary

  • #parts readonly

    The component parts of the list.

Instance Method Summary

Constructor Details

.new(*parts) ⇒ Raw

Creates a new Raw containing #parts

[ GitHub ]

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

def initialize *parts
  @parts = []
  @parts.concat parts
end

Instance Attribute Details

#parts (readonly)

The component parts of the list

[ GitHub ]

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

attr_reader :parts

Instance Method Details

#<<(text)

Appends #text

[ GitHub ]

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

def << text
  @parts << text
end

#==(other)

This method is for internal use only.
[ GitHub ]

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

def == other # :nodoc:
  self.class == other.class and @parts == other.parts
end

#accept(visitor)

Calls #accept_raw+ on visitor

[ GitHub ]

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

def accept visitor
  visitor.accept_raw self
end

#merge(other)

Appends other‘s parts

[ GitHub ]

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

def merge other
  @parts.concat other.parts
end

#pretty_print(q)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rdoc/markup/raw.rb', line 45

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

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

#push(*texts)

Appends texts onto this Paragraph

[ GitHub ]

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

def push *texts
  self.parts.concat texts
end

#text

The raw text

[ GitHub ]

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

def text
  @parts.join ' '
end