Class: OrigenTesters::IGXLBasedTester::Parser::TestInstances

Inherits:
Parser::SearchableHash show all
Defined in:
lib/origen_testers/igxl_based_tester/parser/test_instances.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Parser::SearchableHash

#where

Constructor Details

#initialize(options = {}) ⇒ TestInstances

Returns a new instance of TestInstances.



7
8
9
# File 'lib/origen_testers/igxl_based_tester/parser/test_instances.rb', line 7

def initialize(options = {})
  @parser = options[:parser]
end

Instance Attribute Details

#parserObject

Returns the value of attribute parser.



5
6
7
# File 'lib/origen_testers/igxl_based_tester/parser/test_instances.rb', line 5

def parser
  @parser
end

Instance Method Details

#import(file) ⇒ Object



11
12
13
14
15
16
# File 'lib/origen_testers/igxl_based_tester/parser/test_instances.rb', line 11

def import(file)
  File.readlines(file).each do |line|
    l = TestInstance.new(line, parser: parser)
    self[l.name] = l if l.valid?
  end
end

#inspectObject



18
19
20
# File 'lib/origen_testers/igxl_based_tester/parser/test_instances.rb', line 18

def inspect
  "<TestInstances: #{size}>"
end