Module: Canql::Nodes::TestResult::WithCondition

Defined in:
lib/canql/nodes/test_result.rb

Instance Method Summary collapse

Instance Method Details

#existence_filterObject



17
18
19
# File 'lib/canql/nodes/test_result.rb', line 17

def existence_filter
  { Canql::EQUALS => existence_modifier.text_value.strip != 'no' }
end

#test_result_typeObject



7
8
9
# File 'lib/canql/nodes/test_result.rb', line 7

def test_result_type
  natal_period.text_value.strip
end

#test_result_type_filterObject



21
22
23
# File 'lib/canql/nodes/test_result.rb', line 21

def test_result_type_filter
  { Canql::EQUALS => test_result_type }
end

#to_test_resultObject



11
12
13
14
15
# File 'lib/canql/nodes/test_result.rb', line 11

def to_test_result
  test_result_hash = { 'exists' => existence_filter }
  test_result_hash['type'] = test_result_type_filter if test_result_type.present?
  test_result_hash
end