Class: Shojiku::VerificationReport::Check
- Inherits:
-
Object
- Object
- Shojiku::VerificationReport::Check
- Defined in:
- lib/shojiku/verification_report.rb
Overview
The outcome of one check: passed, or failed with the reason.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(item) ⇒ Check
constructor
A new instance of Check.
- #passed? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(item) ⇒ Check
Returns a new instance of Check.
21 22 23 24 |
# File 'lib/shojiku/verification_report.rb', line 21 def initialize(item) @status = item["status"] @reason = item["reason"] end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
19 20 21 |
# File 'lib/shojiku/verification_report.rb', line 19 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
19 20 21 |
# File 'lib/shojiku/verification_report.rb', line 19 def status @status end |
Instance Method Details
#passed? ⇒ Boolean
26 27 28 |
# File 'lib/shojiku/verification_report.rb', line 26 def passed? @status == "passed" end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/shojiku/verification_report.rb', line 30 def to_s @reason ? "#{@status}: #{@reason}" : @status.to_s end |