Sha256: 5994e387241b8243f0ec5477f94f204f42c171883764296caed28e590d599adb
Contents?: true
Size: 707 Bytes
Versions: 27
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
27 entries across 27 versions & 2 rubygems