moonclerk 1.0.2 → 1.0.3

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
2
  SHA1:
3
- metadata.gz: bd3af2960897e164cd12fea639b548874af21e05
4
- data.tar.gz: 496c95be39699c53cee02c2adfd13e900c82b555
3
+ metadata.gz: 126e2ca5869289f81347158acd7d05c9203b580c
4
+ data.tar.gz: 3e4902a198ab1a5e8f660d9e57295a324ef3b28e
5
5
  SHA512:
6
- metadata.gz: 32367bd0c256a6624b9cffdc095800f549864ce0a9eff84bdaee02b3bba71e2e969df47972ad77afc620db60bed27d83ab8b10eb5d2cbf2f3407af14e08cba28
7
- data.tar.gz: 1335781ea385801a3d8f872402d68b998309e1f2b76e43877a242acb19363b6b63fa67a75cfb9df68e1f28a2fdc1a1aea1661a96ae49abbe6ed867a772c47c82
6
+ metadata.gz: 47ae8cdeb009088b040affa7d238348b9dc7253d1bab559adf947119ae53c751fe18212547a94b96806dde3d3147f0ee9896b5afd767f8e0b17bcb171ce5938b
7
+ data.tar.gz: b410ae66b007eefe45d937f4b13dbd931579d8a899033c5c17d30570f006e541104f146bd25a8b7e498174772fd5b2f456b27136db0b09341887e6cbdb9391d5
@@ -76,6 +76,7 @@ module Moonclerk
76
76
 
77
77
  connection = Faraday.new(ssl_options)
78
78
  response = connection.send(method, url, params, headers)
79
+ handle_api_error(response) if !(200..299).include?(response.status)
79
80
  parsed_response = JSON.parse(response.body)
80
81
  symbolized_response = Util.symbolize_names(parsed_response)
81
82
 
@@ -4,7 +4,7 @@ module Moonclerk
4
4
  def list(params = {})
5
5
  response = request(:get, url, params)
6
6
 
7
- klass = self.is_a?(Moonclerk::ListObject) ? self[:object] : self.class_name.downcase
7
+ klass = self.is_a?(Moonclerk::ListObject) ? self[:object] : self.class_name.underscore.downcase
8
8
  obj = ListObject.construct_from({ data: response, object: klass })
9
9
 
10
10
  # Set a count and offset so that we can fetch the same number when accessing the
@@ -10,7 +10,7 @@ module Moonclerk
10
10
  if self == APIResource
11
11
  raise NotImplementedError.new('APIResource is an abstract class. You should perform actions on its subclasses (Customer, Payment, etc.)')
12
12
  end
13
- "#{API_BASE}/#{CGI.escape(class_name.downcase)}s"
13
+ "#{API_BASE}/#{CGI.escape(class_name.pluralize.downcase)}"
14
14
  end
15
15
 
16
16
  def url
@@ -1,3 +1,3 @@
1
1
  module Moonclerk
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonclerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Hinesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler