Class: Origen::Tester::J750::Generator::Patgroups

Inherits:
Object
  • Object
show all
Includes:
Generator
Defined in:
lib/origen/tester/j750/generator/patgroups.rb

Constant Summary

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

Instance Method Summary (collapse)

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #identity_map, #import, #inhibit_output, #on_close, #output_file, #output_inhibited?, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Instance Method Details

- (Object) add(name, options = {})



11
12
13
14
15
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 11

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

- (Object) finalize(_options = {})



17
18
19
20
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 17

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

- (Object) sort!

Present the patgroups in the final sheet in alphabetical order



23
24
25
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 23

def sort!
  collection.sort_by!(&:name)
end

- (Object) uniq!

Removes all duplicate patgroups



28
29
30
31
32
33
34
35
36
# File 'lib/origen/tester/j750/generator/patgroups.rb', line 28

def uniq!
  uniques = []
  collection.each do |patgroup|
    unless uniques.any? { |p| p == patgroup }
      uniques << patgroup
    end
  end
  self.collection = uniques
end