Sha256: 956a614ee7fe1518e26c044ca79b7a7b4d8f9337af37d93edf9403ea92f368e1

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

module Govspeak
  class EmbedExtractor
    def initialize(document)
      @document = document
    end

    def content_references
      @content_references ||= @document.scan(EmbeddedContent::EMBED_REGEX).map { |match|
        EmbeddedContent.new(document_type: match[1], content_id: match[2], embed_code: match[0])
      }.uniq
    end

    def content_ids
      @content_ids ||= content_references.map(&:content_id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govspeak-8.5.0 lib/govspeak/embed_extractor.rb