Class: Origen::Tester::J750::Generator::Patsets

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

Constant Summary

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

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/patsets.rb', line 11

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

- (Object) finalize(_options = {})



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

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

- (Object) sort!

Present the patsets in the final sheet in alphabetical order



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

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

- (Object) uniq!

Removes all duplicate patsets



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

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