Class: Vangrail::Engine::Screening

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#certainObject

Returns the value of attribute certain

Returns:

  • (Object)

    the current value of certain



76
77
78
# File 'lib/vangrail/engine.rb', line 76

def certain
  @certain
end

#keptObject

Returns the value of attribute kept

Returns:

  • (Object)

    the current value of kept



76
77
78
# File 'lib/vangrail/engine.rb', line 76

def kept
  @kept
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



76
77
78
# File 'lib/vangrail/engine.rb', line 76

def reason
  @reason
end

#rejectedObject

Returns the value of attribute rejected

Returns:

  • (Object)

    the current value of rejected



76
77
78
# File 'lib/vangrail/engine.rb', line 76

def rejected
  @rejected
end

Instance Method Details

#certain?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/vangrail/engine.rb', line 77

def certain?
  certain
end

#rejected?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/vangrail/engine.rb', line 81

def rejected?
  !rejected.empty?
end

#to_hObject



85
86
87
88
89
90
91
92
# File 'lib/vangrail/engine.rb', line 85

def to_h
  {
    'kept' => kept.size,
    'rejected' => rejected.map { |r| r[:result].to_h },
    'certain' => certain?,
    'reason' => reason
  }.compact
end