class RenderAsMarkdown::Link

Attributes

hint[RW]

TODO: look up Github in-document link reference and implement it (e.g. “[A Header](a-header)” )

text[RW]

TODO: look up Github in-document link reference and implement it (e.g. “[A Header](a-header)” )

url[RW]

TODO: look up Github in-document link reference and implement it (e.g. “[A Header](a-header)” )

Public Class Methods

new(url, text=nil, hint=nil) click to toggle source
# File lib/render-as-markdown/link.rb, line 8
def initialize url, text=nil, hint=nil
  @url, @text, @hint = url.to_s, text.to_s, hint.to_s
end

Public Instance Methods

render() click to toggle source
# File lib/render-as-markdown/link.rb, line 12
def render
  text = @text.empty? ? @url : @text
  hint = " \"#{@hint}\"" unless @hint.empty?
  "[#{text}](#{@url}#{hint})"
end
Also aliased as: to_s
to_s()
Alias for: render