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
95
Scan security of your Rails app with Brakeman
rsempe
2
200
Other Decks in Programming
See All in Programming
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
440
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
320
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
160
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
250
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
270
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
120
wkhtmltopdfの次どうするか問題2026
willnet
2
1.7k
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
170
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
210
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The untapped power of vector embeddings
frankvandijk
2
1.9k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
720
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
670
Utilizing Notion as your number one productivity tool
mfonobong
4
600
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
310
Side Projects
sachag
456
43k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
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?