mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-11-27 00:03:06 -05:00
Add a few more comments around new #eql?/#hash
This commit is contained in:
parent
45e807a41a
commit
b43b83cee1
@ -96,13 +96,14 @@ module Stripe
|
||||
other.is_a?(StripeObject) && @values == other.instance_variable_get(:@values)
|
||||
end
|
||||
|
||||
# Hash equality. As with ==, we consider two equivalent Stripe objects equal.
|
||||
# Hash equality. As with `#==`, we consider two equivalent Stripe objects equal.
|
||||
def eql?(other)
|
||||
# Defer to the implementation on `#==`.
|
||||
self == other
|
||||
end
|
||||
|
||||
# As for equality, we hash to Stripe objects to the same value if they're
|
||||
# equivalent objects.
|
||||
# As with equality in `#==` and `#eql?`, we hash two Stripe objects to the
|
||||
# same value if they're equivalent objects.
|
||||
def hash
|
||||
@values.hash
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user