Class: Origen::Tester::Ultraflex::Generator::TestInstanceGroup

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/origen/tester/ultraflex/generator/test_instance_group.rb

Constant Summary

Constant Summary

Constants included from Enumerable

Enumerable::PRIMATIVES

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Enumerable

#debug, #list

Constructor Details

- (TestInstanceGroup) initialize(name, _options = {})

Returns a new instance of TestInstanceGroup



10
11
12
13
14
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 10

def initialize(name, _options = {})
  @name = name
  @store = []
  @append_version = true
end

Instance Attribute Details

- (Object) append_version

Returns the value of attribute append_version



6
7
8
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 6

def append_version
  @append_version
end

- (Object) name

Returns the value of attribute name



6
7
8
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 6

def name
  @name
end

- (Object) version

Returns the value of attribute version



6
7
8
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 6

def version
  @version
end

Instance Method Details

- (Object) <<(instance)



36
37
38
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 36

def <<(instance)
  @store << instance
end

- (Object) ==(other_instance_group)



48
49
50
51
52
53
54
55
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 48

def ==(other_instance_group)
  self.class == other_instance_group.class &&
    unversioned_name.to_s == other_instance_group.unversioned_name.to_s &&
    size == other_instance_group.size &&
    self.all? do |ins|
      other_instance_group.any? { |other_ins| ins == other_ins }
    end
end

- (Object) each



44
45
46
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 44

def each
  @store.each { |ins| yield ins }
end

- (Object) size



40
41
42
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 40

def size
  @store.size
end

- (Object) unversioned_name



26
27
28
29
30
31
32
33
34
# File 'lib/origen/tester/ultraflex/generator/test_instance_group.rb', line 26

def unversioned_name
  if @name
    if @name =~ /grp$/
      @name
    else
      "#{@name}_grp"
    end
  end
end