Class: Vangrail::Triage
- Inherits:
-
Struct
- Object
- Struct
- Vangrail::Triage
- Defined in:
- lib/vangrail/assessor.rb
Overview
What triage returns. The ranking is the product: a caller that wants the
old behaviour reads kept, and one that wants to put the doubtful pages
last reads them in order.
Instance Attribute Summary collapse
-
#judged ⇒ Object
Returns the value of attribute judged.
Instance Method Summary collapse
Instance Attribute Details
#judged ⇒ Object
Returns the value of attribute judged
223 224 225 |
# File 'lib/vangrail/assessor.rb', line 223 def judged @judged end |
Instance Method Details
#certain? ⇒ Boolean
236 237 238 |
# File 'lib/vangrail/assessor.rb', line 236 def certain? judged.all? { |row| row[:judgement].certain? } end |
#dropped ⇒ Object
224 225 226 |
# File 'lib/vangrail/assessor.rb', line 224 def dropped judged.select { |row| row[:judgement].block? } end |
#kept ⇒ Object
232 233 234 |
# File 'lib/vangrail/assessor.rb', line 232 def kept judged.reject { |row| row[:judgement].block? }.reverse.map { |row| row[:document] } end |
#review ⇒ Object
228 229 230 |
# File 'lib/vangrail/assessor.rb', line 228 def review judged.select { |row| row[:judgement].review? } end |
#to_h ⇒ Object
240 241 242 243 244 245 246 247 |
# File 'lib/vangrail/assessor.rb', line 240 def to_h { 'kept' => kept.size, 'review' => review.size, 'dropped' => dropped.map { |row| row[:judgement].to_h }, 'certain' => certain?, } end |