Class: ServerHealthCheckRails::HealthCheck
- Inherits:
-
Object
- Object
- ServerHealthCheckRails::HealthCheck
- Defined in:
- app/models/server_health_check_rails/health_check.rb
Class Method Summary collapse
Instance Method Summary collapse
- #http_status ⇒ Object
-
#initialize(*checks) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
- #to_h ⇒ Object
Constructor Details
#initialize(*checks) ⇒ HealthCheck
Returns a new instance of HealthCheck.
3 4 5 6 |
# File 'app/models/server_health_check_rails/health_check.rb', line 3 def initialize(*checks) @check = ServerHealthCheck.new ServerHealthCheckRails.apply_checks(@check, checks) end |
Class Method Details
.all ⇒ Object
8 9 10 |
# File 'app/models/server_health_check_rails/health_check.rb', line 8 def self.all new(*ServerHealthCheckRails.all_checks) end |
Instance Method Details
#http_status ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/models/server_health_check_rails/health_check.rb', line 12 def http_status if @check.ok? 200 else 500 end end |
#to_h ⇒ Object
20 21 22 23 24 |
# File 'app/models/server_health_check_rails/health_check.rb', line 20 def to_h { status: @check.results } end |