stripe 3.26.0 → 3.26.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/stripe_object.rb +11 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/stripe_object_test.rb +40 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4ac82de8d5c93956f56ab752a21fbd5470aa3f2452c7360c8bad21b62437f1de
|
4
|
+
data.tar.gz: 4c03b8ed0e4d03a24a4b18e6668147b7c88e4ae1977cbb5d7d6319ff4c0535f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3094e2f430018ebba15fe8f78c6b9e28480c8f47ec5aeb3185296a5c7f27357673b3436f1631c76bdc5b09535bdd6885794de7a5b24c6cfe4d6d2fb16e1c68b5
|
7
|
+
data.tar.gz: ef354896a762a5cb3fd34028f9f04413bf1b576b44d040167b2e51fd6724164cb72821a2f4be02679c16ea4663738409b6a83ffd8426a4de2191832f397ed250
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.26.
|
1
|
+
3.26.1
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -96,6 +96,17 @@ module Stripe
|
|
96
96
|
other.is_a?(StripeObject) && @values == other.instance_variable_get(:@values)
|
97
97
|
end
|
98
98
|
|
99
|
+
# Hash equality. As with ==, we consider two equivalent Stripe objects equal.
|
100
|
+
def eql?(other)
|
101
|
+
self == other
|
102
|
+
end
|
103
|
+
|
104
|
+
# As for equality, we hash to Stripe objects to the same value if they're
|
105
|
+
# equivalent objects.
|
106
|
+
def hash
|
107
|
+
@values.hash
|
108
|
+
end
|
109
|
+
|
99
110
|
# Indicates whether or not the resource has been deleted on the server.
|
100
111
|
# Note that some, but not all, resources can indicate whether they have
|
101
112
|
# been deleted.
|
data/lib/stripe/version.rb
CHANGED
@@ -117,6 +117,46 @@ module Stripe
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
context "#eql?" do
|
121
|
+
should "produce the true for two equivalent Stripe objects" do
|
122
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
123
|
+
obj2 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
124
|
+
assert obj1.eql?(obj2)
|
125
|
+
end
|
126
|
+
|
127
|
+
should "produce false for non-equivalent Stripe objects" do
|
128
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
129
|
+
obj2 = Stripe::StripeObject.construct_from(id: 2, name: "Stripe")
|
130
|
+
refute obj1.eql?(obj2)
|
131
|
+
end
|
132
|
+
|
133
|
+
should "produce false for different types" do
|
134
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
135
|
+
obj2 = 7
|
136
|
+
refute obj1.eql?(obj2)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
context "#hash" do
|
141
|
+
should "produce the same hash for two equivalent Stripe objects" do
|
142
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
143
|
+
obj2 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
144
|
+
assert_equal obj1.hash, obj2.hash
|
145
|
+
end
|
146
|
+
|
147
|
+
should "produce different hashes for non-equivalent Stripe objects" do
|
148
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
149
|
+
obj2 = Stripe::StripeObject.construct_from(id: 2, name: "Stripe")
|
150
|
+
refute_equal obj1.hash, obj2.hash
|
151
|
+
end
|
152
|
+
|
153
|
+
should "produce different hashes for different types" do
|
154
|
+
obj1 = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
|
155
|
+
obj2 = 7
|
156
|
+
refute_equal obj1.hash, obj2.hash
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
120
160
|
context "#to_hash" do
|
121
161
|
should "skip calling to_hash on nil" do
|
122
162
|
module NilWithToHash
|
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: 3.26.
|
4
|
+
version: 3.26.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
requirements: []
|
213
213
|
rubyforge_project:
|
214
|
-
rubygems_version: 2.
|
214
|
+
rubygems_version: 2.7.7
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: Ruby bindings for the Stripe API
|