Class: Continuum::Assertion
- Inherits:
-
Object
- Object
- Continuum::Assertion
- Defined in:
- src/lib/continuum/assertion.rb
Overview
Encapsulates all of the data related to assertions returned from Access Engine
Instance Attribute Summary collapse
-
#outcome ⇒ String
Gets the outcome of the assertion.
-
#results ⇒ Array<TestResult>
Gets the array of results for any elements which did not pass testing for the assertion.
-
#test_id ⇒ String
Gets the id of the Access Engine test associated with this assertion.
-
#test_type ⇒ String
Gets the type of Access Engine test being run as part of this assertion.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(test_id, test_type, outcome, results) ⇒ Assertion
constructor
A new instance of Assertion.
Constructor Details
#initialize(test_id, test_type, outcome, results) ⇒ Assertion
Returns a new instance of Assertion.
36 37 38 39 40 41 |
# File 'src/lib/continuum/assertion.rb', line 36 def initialize(test_id, test_type, outcome, results) @test_id = test_id @test_type = test_type @outcome = outcome @results = results end |
Instance Attribute Details
#outcome ⇒ String
Gets the outcome of the assertion.
25 26 27 |
# File 'src/lib/continuum/assertion.rb', line 25 def outcome @outcome end |
#results ⇒ Array<TestResult>
Gets the array of results for any elements which did not pass testing for the assertion.
30 31 32 |
# File 'src/lib/continuum/assertion.rb', line 30 def results @results end |
#test_id ⇒ String
Gets the id of the Access Engine test associated with this assertion.
15 16 17 |
# File 'src/lib/continuum/assertion.rb', line 15 def test_id @test_id end |
#test_type ⇒ String
Gets the type of Access Engine test being run as part of this assertion.
20 21 22 |
# File 'src/lib/continuum/assertion.rb', line 20 def test_type @test_type end |
Class Method Details
.from_json(json_data) ⇒ AccessibilityConcern
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'src/lib/continuum/assertion.rb', line 45 def self.from_json(json_data) parsed = DataUtil.parse_json(json_data) || {} results = parsed['results'].map do|result| TestResult.from_json(result) end return new( parsed['testId'], parsed['testType'], parsed['outcome'], results ) end |