Class: ErrorResponse
- Inherits:
-
Object
- Object
- ErrorResponse
- Defined in:
- lib/error_response.rb
Constant Summary collapse
- GEM_ROOT =
File.("../..", __FILE__)
- YAML_PATH =
'lib/error_response.yml'
Class Method Summary collapse
Class Method Details
.call(key, message = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/error_response.rb', line 6 def self.call(key, =nil) string_hash = YAML.load_file(File.join(GEM_ROOT,YAML_PATH)) err_json = string_hash[key.to_s] || {'error_code' => 500000, 'error_message' => } status = err_json['error_code'] / 1000 { 'status' => status, 'json' => err_json } end |