Sha256: 417a25e589066991c9505aece1df2b6373f4b58d62be341560f49d03182b716f

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

require_relative './marker_tag_pair'

module ArticleFixtureGen
  module Data
    # Builds an array of marker-tag ID strings.
    # FIXME: This should be `BuildMarkerArray` or similar.
    class MarkerArray
      def self.call(attributes:)
        new(attributes).call
      end

      def call
        @attributes.map do |attrib|
          mtp = MarkerTagPair.call id_string: attrib.id_string
          NodeFromMarkup.call mtp
        end
      end

      protected

      def initialize(attributes)
        @attributes = attributes
        self
      end
    end # class ArticleFixtureGen::Data::MarkerArray
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
article_fixture_gen-0.1.2 lib/article_fixture_gen/data/marker_array.rb
article_fixture_gen-0.1.1 lib/article_fixture_gen/data/marker_array.rb