Sha256: 587f7809845da040cb6ede6eb6cd029eeab62c773909296fefea81eec22f1457
Contents?: true
Size: 707 Bytes
Versions: 12
Compression:
Stored size: 707 Bytes
Contents
module GovukTechDocs module TableOfContents class Heading def initialize(element_name:, text:, attributes:, page_url: "") @element_name = element_name @text = text @attributes = attributes @page_url = page_url end def size @element_name.scan(/h(\d)/) && $1 && Integer($1) end def href @page_url + "#" + @attributes["id"] end def title @text end def ==(other) @element_name == other.instance_variable_get("@element_name") && @text == other.instance_variable_get("@text") && @attributes == other.instance_variable_get("@attributes") end end end end
Version data entries
12 entries across 12 versions & 1 rubygems