Module: Airbrake::HashKeyable
- Included in:
- PerformanceBreakdown, Query, Queue, Request
- Defined in:
- lib/airbrake-ruby/hash_keyable.rb
Overview
HashKeyable allows instances of the class to be used as a Hash key in a consistent manner.
The class that includes it must implement to_h, which defines properties that all of the instances must share in order to produce the same #hash.
Instance Method Summary collapse
Instance Method Details
#eql?(other) ⇒ Boolean
28 29 30 |
# File 'lib/airbrake-ruby/hash_keyable.rb', line 28 def eql?(other) other.is_a?(self.class) && other.hash == hash end |
#hash ⇒ Integer
33 34 35 |
# File 'lib/airbrake-ruby/hash_keyable.rb', line 33 def hash to_h.hash end |