Class: RDoc::RD::Inline
- Inherits:
-
Object
- Object
- RDoc::RD::Inline
- Defined in:
- lib/rdoc/rd/inline.rb
Overview
Inline keeps track of markup and labels to create proper links.
Instance Attribute Summary collapse
-
#rdoc ⇒ Object
(also: #to_s)
readonly
The markup of this reference in RDoc format.
-
#reference ⇒ Object
readonly
The text of the reference.
Class Method Summary collapse
-
.new(rdoc, reference = rdoc) ⇒ Object
Creates a new Inline for
rdoc
andreference
.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
-
#append(more) ⇒ Object
Appends
more
to this inline. -
#initialize(rdoc, reference) ⇒ Inline
constructor
Initializes the Inline with
rdoc
andinline
. -
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(rdoc, reference) ⇒ Inline
Initializes the Inline with rdoc
and inline
34 35 36 37 38 39 40 |
# File 'lib/rdoc/rd/inline.rb', line 34 def initialize rdoc, reference # :not-new: @reference = reference.equal?(rdoc) ? reference.dup : reference # unpack @reference = @reference.reference if self.class === @reference @rdoc = rdoc end |
Instance Attribute Details
#rdoc ⇒ Object (readonly) Also known as: to_s
The markup of this reference in RDoc format
15 16 17 |
# File 'lib/rdoc/rd/inline.rb', line 15 def rdoc @rdoc end |
#reference ⇒ Object (readonly)
The text of the reference
10 11 12 |
# File 'lib/rdoc/rd/inline.rb', line 10 def reference @reference end |
Class Method Details
.new(rdoc, reference = rdoc) ⇒ Object
Creates a new Inline for rdoc
and reference
.
rdoc
may be another Inline or a String. If reference
is not given it will use the text from rdoc
.
23 24 25 26 27 28 29 |
# File 'lib/rdoc/rd/inline.rb', line 23 def self.new rdoc, reference = rdoc if self === rdoc and reference.equal? rdoc then rdoc else super end end |
Instance Method Details
#==(other) ⇒ Object
:nodoc:
42 43 44 45 |
# File 'lib/rdoc/rd/inline.rb', line 42 def == other # :nodoc: self.class === other and @reference == other.reference and @rdoc == other.rdoc end |
#append(more) ⇒ Object
Appends more
to this inline. more
may be a String or another Inline.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rdoc/rd/inline.rb', line 50 def append more case more when String then @reference += more @rdoc += more when RDoc::RD::Inline then @reference += more.reference @rdoc += more.rdoc else raise "unknown thingy #{more}" end self end |
#inspect ⇒ Object
:nodoc:
65 66 67 |
# File 'lib/rdoc/rd/inline.rb', line 65 def inspect # :nodoc: "(inline: #{self})" end |