Class: OrigenTesters::IGXLBasedTester::Parser::PatternSet

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

Defined Under Namespace

Classes: Pattern

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, options = {}) ⇒ PatternSet

Returns a new instance of PatternSet.



51
52
53
54
55
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 51

def initialize(line, options = {})
  @parser = options[:parser]
  p = add_pattern_line(line)
  @name = p.pattern_set if p.valid?
end

Class Method Details

.extract_name(line) ⇒ Object



69
70
71
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 69

def self.extract_name(line)
  new(line).name
end

Instance Method Details

#add_pattern_line(line) ⇒ Object



73
74
75
76
77
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 73

def add_pattern_line(line)
  p = Pattern.new(line)
  patterns << Pattern.new(line) if p.valid?
  p
end

#inspectObject

:nodoc:



57
58
59
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 57

def inspect  # :nodoc:
  "<PatternSet: #{name}>"
end

#nameObject



61
62
63
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 61

def name
  @name
end

#pattern_namesObject

Returns an array containing all pattern names contained in this pattern set



85
86
87
88
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 85

def pattern_names
  # This removes the path and extensions
  patterns.map { |pat| pat.name.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') }
end

#patternsObject



65
66
67
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 65

def patterns
  @patterns ||= []
end

#valid?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/origen_testers/igxl_based_tester/parser/pattern_set.rb', line 79

def valid?
  patterns.all?(&:valid?)
end