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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
4
310
Basic Architectures
denyspoltorak
0
660
SourceGeneratorのススメ
htkym
0
190
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
130
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
Featured
See All Featured
Visualization
eitanlees
150
17k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
The Limits of Empathy - UXLibs8
cassininazir
1
210
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Facilitating Awesome Meetings
lara
57
6.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Technical Leadership for Architectural Decision Making
baasie
1
240
The Cult of Friendly URLs
andyhume
79
6.8k
Building Adaptive Systems
keathley
44
2.9k
The Spectacular Lies of Maps
axbom
PRO
1
520
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
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?