class ArticleFixtureGen::Data::SingleMarkerTagPair
Encapsulates a “single marker-tag pair”, or sMTP; an HTML anchor tag with a specifically-formatted ID attribute, an empty :href attribute, and no enclosed content. Different than a “paired marker-tag pair”, which is analogous to two slightly differently-formatted sMTPs separated by content (and with no overlapping pMTPs).
Attributes
counter[R]
label[R]
Public Class Methods
new(config:, counter:)
click to toggle source
# File lib/article_fixture_gen/data/single_marker_tag_pair.rb, line 11 def initialize(config:, counter:) @counter = counter @label = config.smtp_text IceNine.deep_freeze self end
Public Instance Methods
to_html()
click to toggle source
# File lib/article_fixture_gen/data/single_marker_tag_pair.rb, line 17 def to_html ['<a href="" id="', '"></a>'].join html_id end
Also aliased as: to_s
Private Instance Methods
html_id()
click to toggle source
# File lib/article_fixture_gen/data/single_marker_tag_pair.rb, line 26 def html_id [label, counter.to_s].join '-' end