Class: StrictComparableHash
- Inherits:
-
Hash
- Object
- Hash
- StrictComparableHash
- Defined in:
- lib/tasks/capistrano_tasks.rb
Overview
basically { :a => 1, :b => 2 }.eql?({ :b => 2, :a => 1}) => true
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Object
must return an integer or #eql? will be ignored by Comparable assumes hash elements are strings will break if a value is something else whose to_s varies randomly.
Instance Method Details
#eql?(other) ⇒ Boolean
9 10 11 |
# File 'lib/tasks/capistrano_tasks.rb', line 9 def eql?(other) self == other end |
#hash ⇒ Object
must return an integer or #eql? will be ignored by Comparable assumes hash elements are strings will break if a value is something else whose to_s varies randomly
16 17 18 |
# File 'lib/tasks/capistrano_tasks.rb', line 16 def hash Zlib.crc32(to_a.map(&:to_s).sort.to_s) end |