class JekyllRPG::MarkdownLink

A markdown link with components extracted from text [name](/collection/slug)

Public Class Methods

new(link) click to toggle source
# File lib/markdown_link.rb, line 7
def initialize(link)
  @link = link
end

Public Instance Methods

collection() click to toggle source
# File lib/markdown_link.rb, line 19
def collection
  @link[%r{(?<=/).*(?=/)}]
end
name() click to toggle source
# File lib/markdown_link.rb, line 11
def name
  @link[/(?<=\[).*?(?=\])/]
end
slug() click to toggle source
# File lib/markdown_link.rb, line 15
def slug
  @link[%r{(?<=/)(?:(?!/).)*?(?=\))}]
end