Class: Katalyst::Healthcheck::Route
- Inherits:
-
Object
- Object
- Katalyst::Healthcheck::Route
- Defined in:
- lib/katalyst/healthcheck/route.rb
Overview
Represents a status and a message that can be used in a rails route
Class Method Summary collapse
Class Method Details
.from_tasks(detail: false) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/katalyst/healthcheck/route.rb', line 12 def from_tasks(detail: false) Proc.new do |_env| tasks = Task.all status = tasks.all?(&:ok?) ? 200 : 500 = status == 200 ? "OK" : "FAIL" = Task.summary if detail [status, { "Content-Type" => "text/plain" }, []] end end |
.static(status, message) ⇒ Object
8 9 10 |
# File 'lib/katalyst/healthcheck/route.rb', line 8 def static(status, ) Proc.new { |_env| [status, { "Content-Type" => "text/plain" }, []] } end |