Class: CIAT::Subresult

Inherits:
Object
  • Object
show all
Defined in:
lib/ciat/subresult.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lightObject (readonly)

Returns the value of attribute light.



2
3
4
# File 'lib/ciat/subresult.rb', line 2

def light
  @light
end

#path_kindObject (readonly)

Returns the value of attribute path_kind.



3
4
5
# File 'lib/ciat/subresult.rb', line 3

def path_kind
  @path_kind
end

#subtestObject (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

Returns:

  • (Boolean)


13
14
15
# File 'lib/ciat/subresult.rb', line 13

def happy_path?
  path_kind == :happy
end

#processorObject



17
18
19
# File 'lib/ciat/subresult.rb', line 17

def processor
  subtest.processor
end

#relevant_element_namesObject



27
28
29
# File 'lib/ciat/subresult.rb', line 27

def relevant_element_names
  processor.kind.relevant_elements(@light, @subtest.path_kind)
end

#relevant_elementsObject



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