Class: Coradoc::Element::Inline::CrossReference
- Defined in:
- lib/coradoc/element/inline/cross_reference.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
Returns the value of attribute href.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(href, name = nil) ⇒ CrossReference
constructor
A new instance of CrossReference.
- #to_adoc ⇒ Object
Methods inherited from Base
children_accessors, #children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(href, name = nil) ⇒ CrossReference
Returns a new instance of CrossReference.
9 10 11 12 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 9 def initialize(href, name = nil) @href = href @name = name end |
Instance Attribute Details
#href ⇒ Object
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
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
14 15 16 17 18 19 20 |
# File 'lib/coradoc/element/inline/cross_reference.rb', line 14 def to_adoc if @name.to_s.empty? "<<#{@href}>>" else "<<#{@href},#{@name}>>" end end |