Class: CurrentScope::SodPreflight::Result
- Inherits:
-
Struct
- Object
- Struct
- CurrentScope::SodPreflight::Result
- Defined in:
- lib/current_scope/sod_preflight.rb
Overview
One scan's answer, carried as a value instead of left on the module.
Every honesty rule this feature has needed — "an empty list is not an all-clear", "a run that skipped checks under-reports", "a run that inspected nothing proves nothing" — is a question about ONE scan. Holding that on a singleton made the answers depend on call order, needed a fail-closed special case for "never run", and made the rake task capture a flag next to the call so 140 lines later it still meant the right run. A value has none of those problems: you cannot ask a result you do not have. (#133 review — cubic, ie-predictability, ie-architecture all landed on this seam.)
Instance Attribute Summary collapse
-
#in_scope ⇒ Object
Returns the value of attribute in_scope.
-
#inspected ⇒ Object
Returns the value of attribute inspected.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#blind? ⇒ Boolean
The list cannot be read as an all-clear: either a check failed, or there was nothing to read because no controller in scope declared a model.
-
#degraded? ⇒ Boolean
Some check could not be completed, so the list under-reports.
Instance Attribute Details
#in_scope ⇒ Object
Returns the value of attribute in_scope
46 47 48 |
# File 'lib/current_scope/sod_preflight.rb', line 46 def in_scope @in_scope end |
#inspected ⇒ Object
Returns the value of attribute inspected
46 47 48 |
# File 'lib/current_scope/sod_preflight.rb', line 46 def inspected @inspected end |
#rows ⇒ Object
Returns the value of attribute rows
46 47 48 |
# File 'lib/current_scope/sod_preflight.rb', line 46 def rows @rows end |
#skipped ⇒ Object
Returns the value of attribute skipped
46 47 48 |
# File 'lib/current_scope/sod_preflight.rb', line 46 def skipped @skipped end |
Instance Method Details
#any? ⇒ Boolean
54 |
# File 'lib/current_scope/sod_preflight.rb', line 54 def any? = rows.any? |
#blind? ⇒ Boolean
The list cannot be read as an all-clear: either a check failed, or there was nothing to read because no controller in scope declared a model.
52 |
# File 'lib/current_scope/sod_preflight.rb', line 52 def blind? = degraded? || (inspected.zero? && in_scope.positive?) |
#degraded? ⇒ Boolean
Some check could not be completed, so the list under-reports.
48 |
# File 'lib/current_scope/sod_preflight.rb', line 48 def degraded? = skipped.any? |