Class: Marko::Renderers::Link
- Defined in:
- lib/marko/renderers/link.rb
Overview
Link renderer
Constant Summary
Constants inherited from Renderer
Instance Method Summary collapse
-
#initialize ⇒ Link
constructor
A new instance of Link.
- #render(topic) ⇒ Object
Constructor Details
#initialize ⇒ Link
Returns a new instance of Link.
8 9 10 |
# File 'lib/marko/renderers/link.rb', line 8 def initialize @url = Url.new end |
Instance Method Details
#render(topic) ⇒ Object
12 13 14 15 |
# File 'lib/marko/renderers/link.rb', line 12 def render(topic) return "[#{topic}](#unknown)" unless topic.respond_to?(:title) "[#{topic.title}](#{@url.render(topic.id)})" end |