Sha256: 48a76bec74fc04c94bf7ae3ccee65c354e6aa1d3470da620069589000e6b6fad

Contents?: true

Size: 1012 Bytes

Versions: 18

Compression:

Stored size: 1012 Bytes

Contents

module Origen
  module Tester
    class Ultraflex
      module Generator
        class Patgroups
          include Origen::Tester::Generator

          TEMPLATE = "#{Origen.top}/lib/origen/tester/ultraflex/generator/templates/patgroups.txt.erb"
          OUTPUT_POSTFIX = 'patgroups'

          def add(name, options = {})
            p = 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
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
origen-0.2.6 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.5 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.4 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.3 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.2 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.1 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.2.0 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.1.3 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.1.2 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.1.1 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.1.0 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.9 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.8 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.6 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.5 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.4 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.3 lib/origen/tester/ultraflex/generator/patgroups.rb
origen-0.0.2 lib/origen/tester/ultraflex/generator/patgroups.rb