Class: VerifIP::HealthResponse
- Inherits:
-
Object
- Object
- VerifIP::HealthResponse
- Defined in:
- lib/verifip/models.rb
Overview
Response from the health check endpoint.
Instance Attribute Summary collapse
-
#data_loaded_at ⇒ Object
readonly
Returns the value of attribute data_loaded_at.
-
#postgres ⇒ Object
readonly
Returns the value of attribute postgres.
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#uptime_seconds ⇒ Object
readonly
Returns the value of attribute uptime_seconds.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ HealthResponse
Build a HealthResponse from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ HealthResponse
constructor
A new instance of HealthResponse.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ HealthResponse
Returns a new instance of HealthResponse.
96 97 98 99 100 101 102 103 |
# File 'lib/verifip/models.rb', line 96 def initialize(**kwargs) @status = kwargs.fetch(:status, "") @version = kwargs.fetch(:version, "") @data_loaded_at = kwargs.fetch(:data_loaded_at, "") @redis = kwargs.fetch(:redis, "") @postgres = kwargs.fetch(:postgres, "") @uptime_seconds = kwargs.fetch(:uptime_seconds, 0) end |
Instance Attribute Details
#data_loaded_at ⇒ Object (readonly)
Returns the value of attribute data_loaded_at.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def data_loaded_at @data_loaded_at end |
#postgres ⇒ Object (readonly)
Returns the value of attribute postgres.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def postgres @postgres end |
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def redis @redis end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def status @status end |
#uptime_seconds ⇒ Object (readonly)
Returns the value of attribute uptime_seconds.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def uptime_seconds @uptime_seconds end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
94 95 96 |
# File 'lib/verifip/models.rb', line 94 def version @version end |
Class Method Details
.from_hash(hash) ⇒ HealthResponse
Build a HealthResponse from a parsed JSON hash.
109 110 111 112 |
# File 'lib/verifip/models.rb', line 109 def self.from_hash(hash) hash = hash.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } new(**hash.slice(:status, :version, :data_loaded_at, :redis, :postgres, :uptime_seconds)) end |
Instance Method Details
#inspect ⇒ Object
115 |
# File 'lib/verifip/models.rb', line 115 def inspect = to_s |
#to_s ⇒ Object
114 |
# File 'lib/verifip/models.rb', line 114 def to_s = "HealthResponse(status=#{@status}, version=#{@version})" |