class Rack::ECG::Check::Result

Public Instance Methods

as_json() click to toggle source

@return [Hash<Object, Hash<Symbol, Object>>] Result in a hash format. @example A HTTP success response

puts result.as_json
# {:http=>{:status=>"ok", :value=>"online"}}
# File lib/rack/ecg/check.rb, line 29
def as_json
  { name => { status: status, value: value } }
end
to_json() click to toggle source

Return the result as a JSON object.

@return [String] Result in a JSON object string. @example A HTTP success response

puts result.to_json
# {"http": {"status": "ok", "value": "online"}}
# File lib/rack/ecg/check.rb, line 39
def to_json
  JSON.dump(as_json)
end