Class: ReedbHandler
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- ReedbHandler
- Defined in:
- lib/reedb/daemon_wrapper.rb
Overview
HTTP handler class that registers the functions for the vault interface
Instance Method Summary collapse
Instance Method Details
#build_response(status_code, message, payload = nil) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/reedb/daemon_wrapper.rb', line 49 def build_response(status_code, , payload = nil) status status_code # Set http status code content_type 'application/json' response = { 'success' => (status_code >= 400 ? false : true), 'message' => , 'payload' => payload } return response.to_json end |