Module: JSI::Util::Private::FingerprintHash::Immutable Private

Includes:
JSI::Util::Private::FingerprintHash
Defined in:
lib/jsi/util/private.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



162
163
164
165
166
167
168
169
# File 'lib/jsi/util/private.rb', line 162

def ==(other)
  return true if __id__ == other.__id__
  return false unless other.is_a?(FingerprintHash)
  # FingerprintHash::Immutable#hash being memoized, comparing that is basically free.
  # not done with FingerprintHash, its #hash can be expensive.
  return false if other.is_a?(FingerprintHash::Immutable) && hash != other.hash
  jsi_fingerprint == other.jsi_fingerprint
end

#freezeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



177
178
179
180
# File 'lib/jsi/util/private.rb', line 177

def freeze
  hash
  super
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



173
174
175
# File 'lib/jsi/util/private.rb', line 173

def hash
  @jsi_fingerprint_hash ||= jsi_fingerprint.hash
end