Class: Shojiku::VerificationReport::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/shojiku/verification_report.rb

Overview

The outcome of one check: passed, or failed with the reason.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#reasonObject (readonly)

Returns the value of attribute reason.



19
20
21
# File 'lib/shojiku/verification_report.rb', line 19

def reason
  @reason
end

#statusObject (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

Returns:

  • (Boolean)


26
27
28
# File 'lib/shojiku/verification_report.rb', line 26

def passed?
  @status == "passed"
end

#to_sObject



30
31
32
# File 'lib/shojiku/verification_report.rb', line 30

def to_s
  @reason ? "#{@status}: #{@reason}" : @status.to_s
end