Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
0
59
Equality in Ruby
Romain Sempé
August 14, 2012
Tweet
Share
More Decks by Romain Sempé
See All by Romain Sempé
Are you happy with your code quality?
rsempe
0
81
Scan security of your Rails app with Brakeman
rsempe
2
190
Other Decks in Programming
See All in Programming
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Oxlint JS plugins
kazupon
1
700
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
CSC307 Lecture 05
javiergs
PRO
0
490
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AtCoder Conference 2025
shindannin
0
1k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
CSC307 Lecture 08
javiergs
PRO
0
670
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Navigating Team Friction
lara
192
16k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Skip the Path - Find Your Career Trail
mkilby
0
52
Visualization
eitanlees
150
17k
Automating Front-end Workflow
addyosmani
1371
200k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
A designer walks into a library…
pauljervisheath
210
24k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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?