Class: Antlr4::Runtime::ObjectEqualityComparator

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/antlr4/runtime/object_equality_comparator.rb

Instance Method Summary collapse

Instance Method Details

#equals(a, b) ⇒ Object


12
13
14
15
16
# File 'lib/antlr4/runtime/object_equality_comparator.rb', line 12

def equals(a, b)
  return b.nil? if a.nil?

  a.eql?(b)
end

#hash(obj) ⇒ Object


6
7
8
9
10
# File 'lib/antlr4/runtime/object_equality_comparator.rb', line 6

def hash(obj)
  return 0 if obj.nil?

  obj.hash
end