Class: Coradoc::Element::Inline::CrossReference
- Inherits:
-
Object
- Object
- Coradoc::Element::Inline::CrossReference
- Defined in:
- lib/coradoc/element/inline/cross_reference.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(href, name = nil) ⇒ CrossReference
constructor
A new instance of CrossReference.
- #to_adoc ⇒ Object
Constructor Details
#initialize(href, name = nil) ⇒ CrossReference
Returns a new instance of CrossReference.
7 8 9 10 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 7 def initialize(href, name = nil) @href = href @name = name end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 5 def href @href end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 5 def name @name end |
Instance Method Details
#to_adoc ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 12 def to_adoc if @name.to_s.empty? "<<#{@href}>>" else "<<#{@href},#{@name}>>" end end |