Class: Rack::ECG::Check::Result
- Inherits:
-
Struct
- Object
- Struct
- Rack::ECG::Check::Result
- Defined in:
- lib/rack/ecg/check.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#as_json ⇒ Hash<Object, Hash<Symbol, Object>>
Format the result as a JSON compatible hash.
-
#to_json ⇒ String
Return the result as a JSON object.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
24 25 26 |
# File 'lib/rack/ecg/check.rb', line 24 def name @name end |
#status ⇒ Object
Returns the value of attribute status
24 25 26 |
# File 'lib/rack/ecg/check.rb', line 24 def status @status end |
#value ⇒ Object
Returns the value of attribute value
24 25 26 |
# File 'lib/rack/ecg/check.rb', line 24 def value @value end |
Instance Method Details
#as_json ⇒ Hash<Object, Hash<Symbol, Object>>
Format the result as a JSON compatible hash.
31 32 33 |
# File 'lib/rack/ecg/check.rb', line 31 def as_json { name => { status: status, value: value } } end |
#to_json ⇒ String
Return the result as a JSON object.
41 42 43 |
# File 'lib/rack/ecg/check.rb', line 41 def to_json JSON.dump(as_json) end |