Sha256: fef5e7c014e317ab864e6891ac5bc3d4025b85d66faf9854326e417ffd3785f2

Contents?: true

Size: 881 Bytes

Versions: 2

Compression:

Stored size: 881 Bytes

Contents

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

        OUTPUT_POSTFIX = 'patgroups'

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

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

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

        # Removes all duplicate patgroups
        def uniq!
          uniques = []
          collection.each do |patgroup|
            unless uniques.any? { |p| p == patgroup }
              uniques << patgroup
            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/patgroups.rb
origen_testers-0.10.0 lib/origen_testers/igxl_based_tester/base/patgroups.rb