Sha256: c66736cf73b5c655b3c594dea136a2ad6007c843bee498af3e56cc760a992699

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

module OrigenTesters
  module IGXLBasedTester
    class Base
      class Patsubrs
        include ::OrigenTesters::Generator

        OUTPUT_POSTFIX = 'patsubrs'

        def add(name, options = {})
          p = Patsubr.new(name, options)
          collection << p
          p
        end

        def finalize(options = {})
          uniq!
          sort!
        end

        # Present the patsubrs in the final sheet in alphabetical order
        def sort!
          collection.sort_by!(&:name)
        end

        # Removes all duplicate patsubrs
        def uniq!
          uniques = []
          collection.each do |patsubr|
            unless uniques.any? { |p| p == patsubr }
              uniques << patsubr
            end
          end
          self.collection = uniques
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
origen_testers-0.13.2 lib/origen_testers/igxl_based_tester/base/patsubrs.rb
origen_testers-0.10.0 lib/origen_testers/igxl_based_tester/base/patsubrs.rb