stripe 1.56.1 → 1.56.2

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: 7d9f405c4db8edc9240894eb3099379d3d0087a6
4
- data.tar.gz: da77c34e7d3266080224c70e49535273963b93d4
3
+ metadata.gz: 8f3eceb5c2737ff2f2cfaab5341e90c960406cb5
4
+ data.tar.gz: 3f16e6ca7c70444e60c12eda3ef0bd620f6b8e60
5
5
  SHA512:
6
- metadata.gz: 5dbde07ba469e1f1c4d6120bac0856037e7047a776308de7285c6378bb83c1ebf366550498eb894591f374d3982f3caae98d36466da5ba2beeb3c4835295d852
7
- data.tar.gz: 088ce1eb0e4845edfaad0b804a5b8347d65a3eb8c5bfcb25bf6c005212858e6ee08bbf180905bfbebd4561f44187348c346fa86d1bcfade1ded9a05708a21702
6
+ metadata.gz: bb766287faa55616972a6bd6de845b059f9f255bb45a4347f3b8de4b16d35e1f1615882dd768d1f4236786227e375e156702e03219776b793a7f9b0adac50cd5
7
+ data.tar.gz: dd36f2bb9ff499e8b8308cd5a5a2afb32423d77e5415640f007ab989d01b6ad2dd0ea709dda167b8e1cf50f6b4e396c8e0d9671c39507ae16f7f7ded96256ee0
@@ -1,3 +1,7 @@
1
+ === 1.56.2 2016-11-17
2
+
3
+ * Improve `StripeObject`'s `#to_s` to better handle how embedded objects are displayed
4
+
1
5
  === 1.56.1 2016-11-09
2
6
 
3
7
  * Fix (fairly serious) memory like in `StripeObject`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.56.1
1
+ 1.56.2
@@ -43,7 +43,7 @@ module Stripe
43
43
  end
44
44
 
45
45
  def to_s(*args)
46
- JSON.pretty_generate(@values)
46
+ JSON.pretty_generate(to_hash)
47
47
  end
48
48
 
49
49
  def inspect
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.56.1'
2
+ VERSION = '1.56.2'
3
3
  end
@@ -96,7 +96,7 @@ module Stripe
96
96
  obj.update_attributes(:foo => 'bar')
97
97
  assert_equal true, obj.send(:metaclass).method_defined?(:foo)
98
98
  end
99
-
99
+
100
100
  should "warn that #refresh_from is deprecated" do
101
101
  old_stderr = $stderr
102
102
  $stderr = StringIO.new
@@ -292,6 +292,38 @@ module Stripe
292
292
  assert_equal({ :id => 'id', :metadata => { :foo => 'bar' } }, serialized)
293
293
  end
294
294
 
295
+ should "#to_s will call to_s for all embedded stripe objects" do
296
+ obj = Stripe::StripeObject.construct_from({
297
+ id: 'id',
298
+ #embeded list object
299
+ refunds: Stripe::ListObject.construct_from({ data: [
300
+ #embedded object in list
301
+ Stripe::StripeObject.construct_from({
302
+ id: 'id',
303
+ #embedded object in an object in a list object
304
+ metadata: Stripe::StripeObject.construct_from({
305
+ foo: 'bar',
306
+ })
307
+ })
308
+ ]}),
309
+ # embeded stripe object
310
+ metadata: Stripe::StripeObject.construct_from({
311
+ foo: 'bar',
312
+ })
313
+ })
314
+ expected = JSON.pretty_generate({
315
+ id: 'id',
316
+ refunds: {
317
+ data: [
318
+ {id: 'id', metadata: {foo: 'bar'}}
319
+ ]
320
+ },
321
+ metadata: { foo: 'bar' }
322
+ })
323
+
324
+ assert_equal(expected, obj.to_s)
325
+ end
326
+
295
327
  should "warn that .serialize_params is deprecated" do
296
328
  old_stderr = $stderr
297
329
  $stderr = StringIO.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.56.1
4
+ version: 1.56.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client