snap-api 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 995daa2e76ce55d36249cb7ecf64f0dd4d039d4de3b6218d9c62b47673baf798
4
- data.tar.gz: f913194b7fae9a7c4debcb4f2db401704c3a161b6a733feea1891a50d5d07345
2
+ SHA1:
3
+ metadata.gz: 05a35a4a00d74c2748b9a50030b0dda049ce11ae
4
+ data.tar.gz: 46c31a3b9314c29b0b2ecc813bb697b1beb9ae30
5
5
  SHA512:
6
- metadata.gz: 95572db0054c80b7bd2280545c20f5e69ba815f5cef7ccf233c35383bb08689d57f50fb9e091110bdd6fd804b93ef381be4dc71d668372d8a53b186ed5ba2f87
7
- data.tar.gz: bd8eafc05d0b351cbc8cfb3e849b3a84e00e3e3c06513d449d4e1c0158f377410c3cbeb16c960c8d77b209080aee55cc2bdb4a93b66bae062f73680c32fe3268
6
+ metadata.gz: a09843d08bb48e8c289ace0c760a470e4d65f31fd02a6f70c5673efcf231a186f899921025d048f330fe4c60c743e4bf2b2b5abbee7c1244656901d020d2532f
7
+ data.tar.gz: e2998163eda42ce5c418895c40a7511000c4835eaf85a4e2a95394c6869d613ca2c9743bc45afec05e4e04e89121bb7c320b0f414c4557a5a2518f29aa15b426
data/History.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ 0.1.12 / 2019-03-05
3
+ ==================
4
+
5
+ * Add Api::BadRequestError
6
+
2
7
  0.1.11 / 2019-02-28
3
8
  ==================
4
9
 
data/lib/snap.rb CHANGED
@@ -6,6 +6,7 @@ require 'snap/version'
6
6
  require 'snap/client'
7
7
  require 'snap/response'
8
8
 
9
+ require 'snap/api/errors/bad_request_error'
9
10
  require 'snap/api/errors/definition_error'
10
11
  require 'snap/api/errors/order_stage_error'
11
12
  require 'snap/api/errors/stock_total_not_found_error'
@@ -0,0 +1,7 @@
1
+ module Snap
2
+ module Api
3
+ # A Bad Request Error occurs when the service returns 400 code
4
+ class BadRequestError < StandardError
5
+ end
6
+ end
7
+ end
data/lib/snap/client.rb CHANGED
@@ -49,6 +49,7 @@ module Snap
49
49
  when 'Hash'
50
50
  raise Api::OrderStageError, httparty_response if httparty_response.parsed_response.value? 'ORDER_STAGE'
51
51
  raise Api::DefinitionError, httparty_response if httparty_response.parsed_response.value? 'DEFINITION'
52
+ raise Api::BadRequestError, httparty_response if httparty_response.code == 400
52
53
  end
53
54
  end
54
55
  end
data/lib/snap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Snap
2
- VERSION = '0.1.11'.freeze
2
+ VERSION = '0.1.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snap-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-28 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -199,6 +199,7 @@ files:
199
199
  - bin/setup
200
200
  - config/initializers/snap.rb
201
201
  - lib/snap.rb
202
+ - lib/snap/api/errors/bad_request_error.rb
202
203
  - lib/snap/api/errors/definition_error.rb
203
204
  - lib/snap/api/errors/order_stage_error.rb
204
205
  - lib/snap/api/errors/stock_total_not_found_error.rb
@@ -237,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
238
  version: '0'
238
239
  requirements: []
239
240
  rubyforge_project:
240
- rubygems_version: 2.7.6
241
+ rubygems_version: 2.5.2
241
242
  signing_key:
242
243
  specification_version: 4
243
244
  summary: Snap API Client