moneybird 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8eab1f7d579d0a6d670fb28f8e00cf6680861d2
4
- data.tar.gz: caa8e3f8905cc3a0d76b4b8e392a0855152d89f5
3
+ metadata.gz: 0a71f6c3bf7c67ce566d5e65b601c5d18e088b6e
4
+ data.tar.gz: 84f430b9085ea231a82d768f8b24e6fab55f1fa6
5
5
  SHA512:
6
- metadata.gz: e1eec306c6aa65cf1406ea0043a13919f2eebd2207e548807019b7a5ddb429e4a267f48172f0e2337b532e6334a2a1497aa09e990d29fb15c93817ff574d53e6
7
- data.tar.gz: f00f7196f3669a660706eb4c9d0b89310a41fb4708519d94055ca4b02accd7635d04afc4778cd857c23a5278c8d6814d60e62893e8915e10a8178b1ad3e5b861
6
+ metadata.gz: 894f446517bea40ccc38c2dd302f9b6bbbeba66f356ee6f3a9178e3c0efa9deee4f30f4edc11edde696029f1021924e27b61fb6208dec8f4f1d3075e08f4eb58
7
+ data.tar.gz: cb7727d232e24e1ab5954867562e7623f9b043eac3e4931ad1bcafe6ffbb43ef8302d0c7122505d33d926fa677d68f2655386fd314a7a4655ecfdf52250a1ef8
@@ -70,6 +70,7 @@ module Moneybird
70
70
 
71
71
  private
72
72
  def perform(request)
73
+ puts request.body.inspect
73
74
  @_last_response = http.request(request)
74
75
  end
75
76
  end
@@ -15,6 +15,10 @@ module Moneybird
15
15
  persisted? ? "/#{id}" : ""
16
16
  end
17
17
 
18
+ def name
19
+ self.class.name.split('::').last.downcase
20
+ end
21
+
18
22
  def attributes=(attributes)
19
23
  @attributes = attributes
20
24
  attributes.each do |attribute, value|
@@ -42,7 +46,7 @@ module Moneybird
42
46
  end
43
47
 
44
48
  def to_json
45
- JSON.generate(attributes)
49
+ JSON.generate({name => attributes})
46
50
  end
47
51
 
48
52
  module ClassMethods
@@ -18,7 +18,11 @@ module Moneybird::Service
18
18
  def find_by_customer_id(customer_id)
19
19
  result = client.get("#{path}/customer_id/#{customer_id}")
20
20
 
21
- build(JSON.parse(result.body))
21
+ if result.code.to_i == 200
22
+ build(JSON.parse(result.body))
23
+ else
24
+ JSON.parse(result.body)
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -1,3 +1,3 @@
1
1
  module Moneybird
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moneybird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten van Vliet