class HealthTools::Service

Public Instance Methods

get_checksum() click to toggle source
# File lib/health_tools/service.rb, line 21
def get_checksum
  Digest::SHA2.hexdigest(set_content.to_s)
end
reply_health() click to toggle source
# File lib/health_tools/service.rb, line 4
def reply_health
  data = set_content
  data.store("checksum", get_checksum)
  HTTParty.post(ENV['api_url'], body: data)
end
set_content() click to toggle source
# File lib/health_tools/service.rb, line 10
def set_content
  {
      "service_code" => ENV['service_code'],
      "action_name" => "check",
      "start_time" =>  DateTime.now.strftime("%d/%m/%Y %H:%M"),
      "status_code" => "200",
      "value" => "1",
      "note" => "cool",
  }
end