What is the difference between #== and #eql??

Technology CommunityCategory: RubyWhat is the difference between #== and #eql??
VietMX Staff asked 3 years ago

#eql? is sometimes an alternate equality. Hash uses #eql? to test for hash key equality. Numeric types perform type conversion across #== but not across #eql?, thus #eql? performs a stricter comparison than #== in that case.