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
Romain Sempé
August 14, 2012
Programming
65
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
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
170
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
340
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
550
App Intentsのビルドプロセスを支える技術
kntkymt
0
390
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
490
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.7k
Security issues being discussed on Web Platforms
petamoriken
0
970
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.8k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
250
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
470
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
It's Worth the Effort
3n
188
29k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
670
So, you think you're a good person
axbom
PRO
2
2.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Typedesign – Prime Four
hannesfritz
42
3.2k
GraphQLとの向き合い方2022年版
quramy
50
15k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
550
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?