Class: ONCCertificationG10TestKit::Tasks::TestProcedure::Step
- Inherits:
-
Object
- Object
- ONCCertificationG10TestKit::Tasks::TestProcedure::Step
- Defined in:
- lib/onc_certification_g10_test_kit/tasks/test_procedure.rb
Instance Attribute Summary collapse
-
#alternate_test ⇒ Object
Returns the value of attribute alternate_test.
-
#group ⇒ Object
Returns the value of attribute group.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inferno_notes ⇒ Object
Returns the value of attribute inferno_notes.
-
#inferno_supported ⇒ Object
Returns the value of attribute inferno_supported.
-
#inferno_tests ⇒ Object
Returns the value of attribute inferno_tests.
-
#s_u_t ⇒ Object
Returns the value of attribute s_u_t.
-
#t_l_v ⇒ Object
Returns the value of attribute t_l_v.
Instance Method Summary collapse
- #expand_tests(test_list) ⇒ Object
-
#initialize(data) ⇒ Step
constructor
A new instance of Step.
Constructor Details
#initialize(data) ⇒ Step
Returns a new instance of Step.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 35 def initialize(data) @group = data[:group] @id = data[:id] @s_u_t = data[:SUT] @t_l_v = data[:TLV] @inferno_supported = data[:inferno_supported] @inferno_notes = data[:inferno_notes] @alternate_test = data[:alternate_test] @inferno_tests = (data[:inferno_tests]).flatten end |
Instance Attribute Details
#alternate_test ⇒ Object
Returns the value of attribute alternate_test.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def alternate_test @alternate_test end |
#group ⇒ Object
Returns the value of attribute group.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def group @group end |
#id ⇒ Object
Returns the value of attribute id.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def id @id end |
#inferno_notes ⇒ Object
Returns the value of attribute inferno_notes.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def inferno_notes @inferno_notes end |
#inferno_supported ⇒ Object
Returns the value of attribute inferno_supported.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def inferno_supported @inferno_supported end |
#inferno_tests ⇒ Object
Returns the value of attribute inferno_tests.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def inferno_tests @inferno_tests end |
#s_u_t ⇒ Object
Returns the value of attribute s_u_t.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def s_u_t @s_u_t end |
#t_l_v ⇒ Object
Returns the value of attribute t_l_v.
33 34 35 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 33 def t_l_v @t_l_v end |
Instance Method Details
#expand_tests(test_list) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/onc_certification_g10_test_kit/tasks/test_procedure.rb', line 46 def (test_list) return [] if test_list.nil? test_list.map do |test| if test.include?(' - ') first, second = test.split(' - ') prefix, _, beginning = first.rpartition('.') second_prefix, _, ending = second.rpartition('.') raise "'#{prefix}' != '#{second_prefix}' in #{@group} #{@id}" unless prefix == second_prefix (beginning.to_i..ending.to_i).map { |index| "#{prefix}.#{format('%02<index>d', { index: })}" } else [test] end end end |