Class: CTioga2::Commands::Documentation::MarkedUpText::MarkupLink
- Inherits:
-
MarkupItem
- Object
- MarkupItem
- CTioga2::Commands::Documentation::MarkedUpText::MarkupLink
- Defined in:
- lib/ctioga2/commands/doc/markup.rb
Overview
A link to a type/group/command
Instance Attribute Summary collapse
-
#dbg ⇒ Object
readonly
For error reporting.
-
#target ⇒ Object
The object target of the link.
Attributes inherited from MarkupItem
Instance Method Summary collapse
- #dump_string ⇒ Object
-
#initialize(doc, target, type) ⇒ MarkupLink
constructor
target is the name of the target, which can be of type ‘group’, ‘command’, ‘backend’, ‘type’, ‘function’ and ‘url’.
- #to_s ⇒ Object
Constructor Details
#initialize(doc, target, type) ⇒ MarkupLink
target is the name of the target, which can be of type ‘group’, ‘command’, ‘backend’, ‘type’, ‘function’ and ‘url’
115 116 117 118 119 120 121 122 123 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 115 def initialize(doc, target, type) super(doc) @dbg = [target, type] if type =~ /url/ @target = target else @target = doc.send("#{type}s")[target] end end |
Instance Attribute Details
#dbg ⇒ Object (readonly)
For error reporting
111 112 113 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 111 def dbg @dbg end |
#target ⇒ Object
The object target of the link
108 109 110 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 108 def target @target end |
Instance Method Details
#dump_string ⇒ Object
137 138 139 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 137 def dump_string return "link: #{@target}" end |
#to_s ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/ctioga2/commands/doc/markup.rb', line 125 def to_s if @target begin return @target.name rescue NoMethodError return @target end else return "unknown" end end |