Class: Vangrail::Rails::Missing
- Inherits:
-
Vangrail::Rail
- Object
- Vangrail::Rail
- Vangrail::Rails::Missing
- Defined in:
- lib/vangrail/rails/missing.rb
Overview
Stands in for a rail that was asked for and could not be built.
Without this, a configuration asking for a model-backed rail against an endpoint that is down produces an engine holding only its offline rails. Those rails pass, the engine reports passed and certain, and the answer is a lie: the check the operator configured never ran.
A placeholder that always returns unchecked keeps the arithmetic right. The turn is allowed, the engine's result is uncertain, and the reason names what is missing and why.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #call(_text, _context) ⇒ Object
-
#initialize(reason:, name: 'missing', sides: Rail::SIDES) ⇒ Missing
constructor
A new instance of Missing.
- #offline? ⇒ Boolean
- #placeholder? ⇒ Boolean
Constructor Details
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
18 19 20 |
# File 'lib/vangrail/rails/missing.rb', line 18 def reason @reason end |
Instance Method Details
#call(_text, _context) ⇒ Object
33 34 35 |
# File 'lib/vangrail/rails/missing.rb', line 33 def call(_text, _context) unchecked(reason) end |
#offline? ⇒ Boolean
25 26 27 |
# File 'lib/vangrail/rails/missing.rb', line 25 def offline? true end |
#placeholder? ⇒ Boolean
29 30 31 |
# File 'lib/vangrail/rails/missing.rb', line 29 def placeholder? true end |