Class: Origen::Tester::Doc::Generator::TestGroup
- Includes:
- Enumerable
- Defined in:
- lib/origen/tester/doc/generator/test_group.rb
Constant Summary
Constants included from Enumerable
Instance Attribute Summary collapse
-
#append_version ⇒ Object
Returns the value of attribute append_version.
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #<<(instance) ⇒ Object
- #==(other_instance_group) ⇒ Object
- #each ⇒ Object
-
#initialize(name, _options = {}) ⇒ TestGroup
constructor
A new instance of TestGroup.
- #size ⇒ Object
- #to_yaml(options = {}) ⇒ Object
- #unversioned_name ⇒ Object
Methods included from Enumerable
Constructor Details
#initialize(name, _options = {}) ⇒ TestGroup
Returns a new instance of TestGroup.
10 11 12 13 14 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 10 def initialize(name, = {}) @name = name @store = [] @append_version = true end |
Instance Attribute Details
#append_version ⇒ Object
Returns the value of attribute append_version.
6 7 8 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 6 def append_version @append_version end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 6 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 6 def version @version end |
Instance Method Details
#<<(instance) ⇒ Object
42 43 44 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 42 def <<(instance) @store << instance end |
#==(other_instance_group) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 54 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 |
#each ⇒ Object
50 51 52 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 50 def each @store.each { |ins| yield ins } end |
#size ⇒ Object
46 47 48 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 46 def size @store.size end |
#to_yaml(options = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 26 def to_yaml( = {}) y = {} y['group'] = @store.map { |t| t.to_yaml() } y end |
#unversioned_name ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/origen/tester/doc/generator/test_group.rb', line 32 def unversioned_name if @name if @name =~ /grp$/ @name else "#{@name}_grp" end end end |