Class: RDoc::Markup::Raw
- Inherits:
-
Object
- Object
- RDoc::Markup::Raw
- Defined in:
- lib/rdoc/markup/raw.rb
Overview
A section of text that is added to the output document as-is
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
The component parts of the list.
Instance Method Summary collapse
-
#<<(text) ⇒ Object
Appends
text
. -
#==(other) ⇒ Object
:nodoc:.
-
#accept(visitor) ⇒ Object
Calls #accept_raw+ on
visitor
. -
#initialize(*parts) ⇒ Raw
constructor
Creates a new Raw containing
parts
. -
#merge(other) ⇒ Object
Appends
other
‘s parts. -
#pretty_print(q) ⇒ Object
:nodoc:.
-
#push(*texts) ⇒ Object
Appends
texts
onto this Paragraph. -
#text ⇒ Object
The raw text.
Constructor Details
#initialize(*parts) ⇒ Raw
Creates a new Raw containing parts
14 15 16 17 |
# File 'lib/rdoc/markup/raw.rb', line 14 def initialize *parts @parts = [] @parts.concat parts end |
Instance Attribute Details
#parts ⇒ Object (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
#<<(text) ⇒ Object
Appends text
22 23 24 |
# File 'lib/rdoc/markup/raw.rb', line 22 def << text @parts << text end |
#==(other) ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/rdoc/markup/raw.rb', line 26 def == other # :nodoc: self.class == other.class and @parts == other.parts end |
#accept(visitor) ⇒ Object
Calls #accept_raw+ on visitor
33 34 35 |
# File 'lib/rdoc/markup/raw.rb', line 33 def accept visitor visitor.accept_raw self end |
#merge(other) ⇒ Object
Appends other
‘s parts
40 41 42 |
# File 'lib/rdoc/markup/raw.rb', line 40 def merge other @parts.concat other.parts end |
#pretty_print(q) ⇒ Object
: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{1,4})/i q.group 2, "[#{$1.downcase}: ", ']' do q.seplist @parts do |part| q.pp part end end end |
#push(*texts) ⇒ Object
Appends texts
onto this Paragraph
57 58 59 |
# File 'lib/rdoc/markup/raw.rb', line 57 def push *texts self.parts.concat texts end |
#text ⇒ Object
The raw text
64 65 66 |
# File 'lib/rdoc/markup/raw.rb', line 64 def text @parts.join ' ' end |