Class: CIAT::Subresult
- Inherits:
-
Object
- Object
- CIAT::Subresult
- Defined in:
- lib/ciat/subresult.rb
Instance Attribute Summary collapse
-
#light ⇒ Object
readonly
Returns the value of attribute light.
-
#path_kind ⇒ Object
readonly
Returns the value of attribute path_kind.
-
#subtest ⇒ Object
readonly
Returns the value of attribute subtest.
Instance Method Summary collapse
- #happy_path? ⇒ Boolean
-
#initialize(elements, path_kind, light, subtest) ⇒ Subresult
constructor
A new instance of Subresult.
- #processor ⇒ Object
- #relevant_element_names ⇒ Object
- #relevant_elements ⇒ Object
Constructor Details
#initialize(elements, path_kind, light, subtest) ⇒ Subresult
Returns a new instance of Subresult.
6 7 8 9 10 11 |
# File 'lib/ciat/subresult.rb', line 6 def initialize(elements, path_kind, light, subtest) @elements = elements @path_kind = path_kind @light = light @subtest = subtest end |
Instance Attribute Details
#light ⇒ Object (readonly)
Returns the value of attribute light.
2 3 4 |
# File 'lib/ciat/subresult.rb', line 2 def light @light end |
#path_kind ⇒ Object (readonly)
Returns the value of attribute path_kind.
3 4 5 |
# File 'lib/ciat/subresult.rb', line 3 def path_kind @path_kind end |
#subtest ⇒ Object (readonly)
Returns the value of attribute subtest.
4 5 6 |
# File 'lib/ciat/subresult.rb', line 4 def subtest @subtest end |
Instance Method Details
#happy_path? ⇒ Boolean
13 14 15 |
# File 'lib/ciat/subresult.rb', line 13 def happy_path? path_kind == :happy end |
#processor ⇒ Object
17 18 19 |
# File 'lib/ciat/subresult.rb', line 17 def processor subtest.processor end |
#relevant_element_names ⇒ Object
27 28 29 |
# File 'lib/ciat/subresult.rb', line 27 def relevant_element_names processor.kind.relevant_elements(@light, @subtest.path_kind) end |
#relevant_elements ⇒ Object
21 22 23 24 25 |
# File 'lib/ciat/subresult.rb', line 21 def relevant_elements relevant_element_names. select { |name| @elements.element?(name) }. map { |name| @elements.element(name) } end |