Class: Mercy::Status
- Inherits:
-
Object
- Object
- Mercy::Status
- Defined in:
- lib/mercy/status.rb
Instance Attribute Summary collapse
-
#reports ⇒ Object
readonly
Returns the value of attribute reports.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(reports) ⇒ Status
constructor
A new instance of Status.
- #status ⇒ Object
Constructor Details
#initialize(reports) ⇒ Status
Returns a new instance of Status.
5 6 7 |
# File 'lib/mercy/status.rb', line 5 def initialize(reports) @reports = reports end |
Instance Attribute Details
#reports ⇒ Object (readonly)
Returns the value of attribute reports.
3 4 5 |
# File 'lib/mercy/status.rb', line 3 def reports @reports end |
Instance Method Details
#as_json ⇒ Object
13 14 15 16 17 |
# File 'lib/mercy/status.rb', line 13 def as_json { status: status }.merge(reports_jsons) end |
#status ⇒ Object
9 10 11 |
# File 'lib/mercy/status.rb', line 9 def status reports.any? { |r| r.error? } ? :error : :ok end |