Module: ServerUtils
- Defined in:
- lib/schemaless_rest_api/server_utils.rb
Overview
Helper methods added to RestServer
Instance Method Summary collapse
Instance Method Details
#id?(model, id) ⇒ Boolean
16 17 18 |
# File 'lib/schemaless_rest_api/server_utils.rb', line 16 def id?(model, id) Entities.models[model].key?(id) end |
#log(messages) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/schemaless_rest_api/server_utils.rb', line 7 def log() if SchemalessRestApi.log_type == :ougai log_structured() else = .values.join(", ") SchemalessRestApi.logger.info "#{}, #{request.request_method} #{request.fullpath}, CorrelationId: #{@request_id}" end end |
#not_have(id) ⇒ Object
20 21 22 |
# File 'lib/schemaless_rest_api/server_utils.rb', line 20 def not_have(id) [404, JSON.generate({ error: "'#{id}' not found" })] end |