class Gemtext::Link
Attributes
description[R]
target[R]
Public Class Methods
[](target, description = nil)
click to toggle source
# File lib/gemtext/link.rb, line 12 def self.[](target, description = nil) new "#{target} #{description}" end
new(content)
click to toggle source
Calls superclass method
# File lib/gemtext/link.rb, line 6 def initialize(content) super content @target = @content.split(/\s+/).first @description = content.delete_prefix(@target).strip end
Public Instance Methods
==(other)
click to toggle source
# File lib/gemtext/link.rb, line 16 def ==(other) other.class == self.class && other.target == @target && other.description == @description end