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
33 34 35 36 37 38 39 |
# File 'lib/rdoc/rd/inline.rb', line 33 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
14 15 16 |
# File 'lib/rdoc/rd/inline.rb', line 14 def rdoc @rdoc end |
#reference ⇒ Object (readonly)
The text of the reference
9 10 11 |
# File 'lib/rdoc/rd/inline.rb', line 9 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
.
22 23 24 25 26 27 28 |
# File 'lib/rdoc/rd/inline.rb', line 22 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:
41 42 43 44 |
# File 'lib/rdoc/rd/inline.rb', line 41 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.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rdoc/rd/inline.rb', line 49 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:
64 65 66 |
# File 'lib/rdoc/rd/inline.rb', line 64 def inspect # :nodoc: "(inline: #{self})" end |