Class: Vangrail::Engine::Screening
- Inherits:
-
Struct
- Object
- Struct
- Vangrail::Engine::Screening
- Defined in:
- lib/vangrail/engine.rb
Overview
What screen returns. certain means what it means on a Result: false says
a rail did not reach a decision about some document, so "nothing was
rejected" is not evidence that nothing was wrong.
Instance Attribute Summary collapse
-
#certain ⇒ Object
Returns the value of attribute certain.
-
#kept ⇒ Object
Returns the value of attribute kept.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#rejected ⇒ Object
Returns the value of attribute rejected.
Instance Method Summary collapse
Instance Attribute Details
#certain ⇒ Object
Returns the value of attribute certain
80 81 82 |
# File 'lib/vangrail/engine.rb', line 80 def certain @certain end |
#kept ⇒ Object
Returns the value of attribute kept
80 81 82 |
# File 'lib/vangrail/engine.rb', line 80 def kept @kept end |
#reason ⇒ Object
Returns the value of attribute reason
80 81 82 |
# File 'lib/vangrail/engine.rb', line 80 def reason @reason end |
#rejected ⇒ Object
Returns the value of attribute rejected
80 81 82 |
# File 'lib/vangrail/engine.rb', line 80 def rejected @rejected end |
Instance Method Details
#cells ⇒ Object
89 90 91 |
# File 'lib/vangrail/engine.rb', line 89 def cells kept.map { |document| Cell.data(Cell.text_of(document)) } end |
#certain? ⇒ Boolean
81 82 83 |
# File 'lib/vangrail/engine.rb', line 81 def certain? certain end |
#rejected? ⇒ Boolean
85 86 87 |
# File 'lib/vangrail/engine.rb', line 85 def rejected? !rejected.empty? end |
#to_h ⇒ Object
93 94 95 96 97 98 99 100 |
# File 'lib/vangrail/engine.rb', line 93 def to_h { 'kept' => kept.size, 'rejected' => rejected.map { |r| r[:result].to_h }, 'certain' => certain?, 'reason' => reason, }.compact end |