Class: OrigenTesters::Parser::DescriptionLookup

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/parser/description_lookup.rb

Instance Method Summary collapse

Constructor Details

#initializeDescriptionLookup

Returns a new instance of DescriptionLookup.



4
5
6
# File 'lib/origen_testers/parser/description_lookup.rb', line 4

def initialize
  @store = { flow: {}, test: {}, usage: {} }
end

Instance Method Details

#add_for_flow(flow, description, options = {}) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/origen_testers/parser/description_lookup.rb', line 25

def add_for_flow(flow, description, options = {})
  k = flow_key(flow)
  @store[:flow][k] ||= []
  [description].flatten.each do |d|
    @store[:flow][k] << d
  end
end

#add_for_test_definition(test, description, option = {}) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/origen_testers/parser/description_lookup.rb', line 33

def add_for_test_definition(test, description, option = {})
  n = name_key(test)
  @store[:test][n] ||= []
  [description].flatten.each do |d|
    @store[:test][n] << d
  end
end

#add_for_test_usage(test, flow, description, option = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/origen_testers/parser/description_lookup.rb', line 41

def add_for_test_usage(test, flow, description, option = {})
  k = flow_key(flow)
  n = name_key(test)
  @store[:usage][k] ||= {}
  @store[:usage][k][n] ||= []
  [description].flatten.each do |d|
    @store[:usage][k][n] << d
  end
end

#for_flow(name, options = {}) ⇒ Object



8
9
10
11
# File 'lib/origen_testers/parser/description_lookup.rb', line 8

def for_flow(name, options = {})
  k = flow_key(name)
  @store[:flow][k] || []
end

#for_test_definition(name, options = {}) ⇒ Object



13
14
15
16
# File 'lib/origen_testers/parser/description_lookup.rb', line 13

def for_test_definition(name, options = {})
  n = name_key(name)
  @store[:test][n] || []
end

#for_test_usage(name, flow, options = {}) ⇒ Object



18
19
20
21
22
23
# File 'lib/origen_testers/parser/description_lookup.rb', line 18

def for_test_usage(name, flow, options = {})
  k = flow_key(flow)
  n = name_key(name)
  @store[:usage][k] ||= {}
  @store[:usage][k][n] || []
end