Class: OrigenTesters::SmartestBasedTester::Base::TestMethods::Limits

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_method) ⇒ Limits

Returns a new instance of Limits.



16
17
18
19
20
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 16

def initialize(test_method)
  @test_method = test_method
  @tnum = ''
  @render = true
end

Instance Attribute Details

#hi_limitObject Also known as: hi

Returns the value of attribute hi_limit.



7
8
9
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 7

def hi_limit
  @hi_limit
end

#lo_limitObject Also known as: lo

Returns the value of attribute lo_limit.



7
8
9
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 7

def lo_limit
  @lo_limit
end

#renderObject

Returns the value of attribute render.



10
11
12
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 10

def render
  @render
end

#test_methodObject (readonly)

Returns the value of attribute test_method.



6
7
8
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 6

def test_method
  @test_method
end

#tnumObject

Returns the value of attribute tnum.



9
10
11
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 9

def tnum
  @tnum
end

#unitObject

Returns the value of attribute unit.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 8

def unit
  @unit
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 68

def render?
  @render
end

#set_hi_limit(val) ⇒ Object



53
54
55
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 53

def set_hi_limit(val)
  self.hi_limit = val
end

#set_lo_limit(val) ⇒ Object



49
50
51
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 49

def set_lo_limit(val)
  self.lo_limit = val
end

#to_atp_attributesObject



57
58
59
60
61
62
63
64
65
66
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 57

def to_atp_attributes
  r = []
  if lo_limit
    r << { value: lo_limit, rule: 'LE', units: unit }
  end
  if hi_limit
    r << { value: hi_limit, rule: 'GE', units: unit }
  end
  r
end

#to_sObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb', line 33

def to_s
  if !lo_limit && !hi_limit
    if tnum == ''
      "\"#{test_name}\"" + ' = "":"NA":"":"NA":"":"":""'
    else
      "\"#{test_name}\"" + " = \"\":\"NA\":\"\":\"NA\":\"\":\"#{tnum}\":\"0\""
    end
  elsif !lo_limit
    "\"#{test_name}\"" + " = \"\":\"NA\":\"#{hi_limit}\":\"LE\":\"#{unit}\":\"#{tnum}\":\"0\""
  elsif !hi_limit
    "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"\":\"NA\":\"#{unit}\":\"#{tnum}\":\"0\""
  else
    "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"#{hi_limit}\":\"LE\":\"#{unit}\":\"#{tnum}\":\"0\""
  end
end