Sha256: 486c7f01f8a8fbb82a30bf77d5b685fb0629f9852e3931ecf8ef8596a21eb826

Contents?: true

Size: 506 Bytes

Versions: 11

Compression:

Stored size: 506 Bytes

Contents

# frozen_string_literal: true

module Spandx
  module Parsers
    class Base
      attr_reader :catalogue

      def initialize(catalogue:)
        @catalogue = catalogue
      end

      class << self
        include Enumerable

        def each(&block)
          registry.each do |x|
            block.call(x)
          end
        end

        def inherited(subclass)
          registry.push(subclass)
        end

        def registry
          @registry ||= []
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spandx-0.5.0 lib/spandx/parsers/base.rb
spandx-0.4.1 lib/spandx/parsers/base.rb
spandx-0.4.0 lib/spandx/parsers/base.rb
spandx-0.3.0 lib/spandx/parsers/base.rb
spandx-0.2.0 lib/spandx/parsers/base.rb
spandx-0.1.7 lib/spandx/parsers/base.rb
spandx-0.1.6 lib/spandx/parsers/base.rb
spandx-0.1.5 lib/spandx/parsers/base.rb
spandx-0.1.4 lib/spandx/parsers/base.rb
spandx-0.1.3 lib/spandx/parsers/base.rb
spandx-0.1.2 lib/spandx/parsers/base.rb