Class: Phlex::Reactive::Doctor::Check
- Inherits:
-
Object
- Object
- Phlex::Reactive::Doctor::Check
- Defined in:
- lib/phlex/reactive/doctor.rb
Overview
The result of one check: a status (:ok/:fail/:unknown), a human message, and (on anything but :ok) a fix line telling the adopter what to do. A plain value object (not Data) so it takes positional status/message plus keyword name:/fix: — the shape the check builders and specs construct.
Instance Attribute Summary collapse
-
#fix ⇒ Object
readonly
Returns the value of attribute fix.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#initialize(status, message, name: nil, fix: nil) ⇒ Check
constructor
A new instance of Check.
- #ok? ⇒ Boolean
- #unknown? ⇒ Boolean
Constructor Details
#initialize(status, message, name: nil, fix: nil) ⇒ Check
Returns a new instance of Check.
26 27 28 29 30 31 |
# File 'lib/phlex/reactive/doctor.rb', line 26 def initialize(status, , name: nil, fix: nil) @name = name @status = status @message = @fix = fix end |
Instance Attribute Details
#fix ⇒ Object (readonly)
Returns the value of attribute fix.
24 25 26 |
# File 'lib/phlex/reactive/doctor.rb', line 24 def fix @fix end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
24 25 26 |
# File 'lib/phlex/reactive/doctor.rb', line 24 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/phlex/reactive/doctor.rb', line 24 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
24 25 26 |
# File 'lib/phlex/reactive/doctor.rb', line 24 def status @status end |
Instance Method Details
#fail? ⇒ Boolean
34 |
# File 'lib/phlex/reactive/doctor.rb', line 34 def fail? = status == :fail |
#ok? ⇒ Boolean
33 |
# File 'lib/phlex/reactive/doctor.rb', line 33 def ok? = status == :ok |
#unknown? ⇒ Boolean
35 |
# File 'lib/phlex/reactive/doctor.rb', line 35 def unknown? = status == :unknown |