error_response 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/error_response.rb +6 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58c7b624776222e9871b4743920886d4952f5633c84b45a73afdedaffe5c6cd3
4
- data.tar.gz: 78a6d179ef3f1658378e3590e9409d98e1f761358f94d3306ecb58d5dde6a763
3
+ metadata.gz: 9399ce1f1928133803e46493fdd9a83e89b4c91002ec1168173081f5ecc5a9d7
4
+ data.tar.gz: 9255d7dc8f8d9274dabd4e4d274d0d99900edbd66723f7335ed5eaf20f97e379
5
5
  SHA512:
6
- metadata.gz: 9c7b31c2cee485a6636c5a24aa2136d440fbddbe368121a9d15f742a36a5bb3eb9cf5dc5921acd06e33db32fe30c12f45adfa3d5993f0de23f5ffbf7e1f54252
7
- data.tar.gz: a4c5fc1bd33b750df2171c1cb521fd912d6d948e9f1ff7eff4f51cc2131fdf23dd312854ed54318d03358e7ad98dd0c351d7501f99332fdf39b3c9f1e4938e53
6
+ metadata.gz: a70f5c87344a5fc8561eaa00807b4eb9dd50f5766dba600457991241b52e0490b7fd0f180c9af96d4fa0e27871fa4a4c78a8e5c8c0a9bf12f8c24ffa2489f629
7
+ data.tar.gz: dcfa05015e5da084ad0aab70ce9c90af354a54d8cc602f515c622ca68de290c453565537b591968ba9923063606a4bd6731d637c7e8912af19dd3ee7a24eb71e
@@ -3,7 +3,7 @@ class ErrorResponse
3
3
  GEM_ROOT = File.expand_path("../..", __FILE__)
4
4
  YAML_PATH = 'lib/error_response.yml'
5
5
 
6
- def self.call(key, message=nil)
6
+ def self.to_api(key, message=nil)
7
7
  string_hash = YAML.load_file(File.join(GEM_ROOT,YAML_PATH))
8
8
  err_json = string_hash[key.to_s] || {'error_code' => 500000, 'error_message' => message}
9
9
 
@@ -13,4 +13,9 @@ class ErrorResponse
13
13
  'json' => err_json
14
14
  }
15
15
  end
16
+
17
+ def self.to_hash(key)
18
+ string_hash = YAML.load_file(File.join(GEM_ROOT,YAML_PATH))
19
+ string_hash[key.to_s]
20
+ end
16
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_response
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jameslee