Class: ArticleFixtureGen::Data::MtpDecoratedMarkup

Inherits:
Object
  • Object
show all
Defined in:
lib/article_fixture_gen/data/mtp_decorated_markup.rb

Overview

Shared logic for marker tag pairs, both single MTPs and paired MTPs. This has been reworked so that the ‘attributes` parameter specifies the number of marker-tag pairs to be generated, by specifying the ID attributes of each MTP to be generated, working from the end of the content toward the beginning. From the standpoint of this class and its collaborators, doing so eliminates any need to differentiate between sMTPs and pMTPs, since each marker-tag pair is generated based on passed-in information.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(attributes:, base_markup:) ⇒ Object



19
20
21
# File 'lib/article_fixture_gen/data/mtp_decorated_markup.rb', line 19

def self.call(attributes:, base_markup:)
  new(attributes).call(base_markup)
end

Instance Method Details

#call(base_markup) ⇒ Object



23
24
25
26
27
# File 'lib/article_fixture_gen/data/mtp_decorated_markup.rb', line 23

def call(base_markup)
  parent_node = NodeFromMarkup.call base_markup
  add_entries(parent_node)
  MarkupFromNode.call parent_node
end