Sha256: 3e54f16a732f383d04df8b91c90fbe16bf716fb0d84984eacbfab57d650ded09
Contents?: true
Size: 694 Bytes
Versions: 36
Compression:
Stored size: 694 Bytes
Contents
#! no set module # Extracts all information needed to generate the link editor form # from a link syntax string class LinkParser attr_reader :name, :options, :field, :raw def self.new link_string return super if link_string.is_a? String OpenStruct.new(name: "", options: {}, raw: "[[ ]]") end def initialize link_string @raw = link_string link = Card::Content::Chunk::Link.new link_string, nil init_name link.name @options = link.options end def title @options && @options[:title] end def field? @field end private def init_name name @field = name.to_name.simple_relative? @name = @field ? name.to_s[1..-1] : name end end
Version data entries
36 entries across 36 versions & 2 rubygems