Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Equality in Ruby
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Romain Sempé
August 14, 2012
Programming
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Equality in Ruby
Romain Sempé
August 14, 2012
More Decks by Romain Sempé
See All by Romain Sempé
Are you happy with your code quality?
rsempe
0
96
Scan security of your Rails app with Brakeman
rsempe
2
200
Other Decks in Programming
See All in Programming
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
420
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
450
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
The Rails Doctrine Decade
koic
2
590
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Done Done
chrislema
187
17k
Fireside Chat
paigeccino
43
4.1k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
Transcript
Equality in Ruby Romain Sempé @rsempe
Equality or Identity? Equality: Different objects that represent the
same value. Identity: Different variables that refer to the same object.
Equal yes! But in what sense? What equality methods
should we use? == eql? equal? === =~
== Test only if the objects have the same value.
eql? Test if the objects have the same value and
the same type.
equal? Test if the objects have the same value, the
same type and are the same instance in memory.
=== Same as == but for case statements. One operator
depending on the context of the comparison (Class, Range, Regexp, …).
=~ Interesting with the Regexp class. It’s an alias to
the match method.
Conclusion == is great most of the time
eql? and equal? can be useful to be more precise Elegant case statements with === Concise test for Regexp with =~ Only one identity operator: equal?