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
Ruby Trivia
Search
Erik Berlin
October 01, 2015
Programming
1.4k
2
Share
Ruby Trivia
Presented at the Berlin Ruby User Group (RUG::B) on October 1, 2015.
Erik Berlin
October 01, 2015
More Decks by Erik Berlin
See All by Erik Berlin
Enumerator::Lazy
sferik
2
650
Ruby Trivia 3
sferik
0
770
The Value of Being Lazy
sferik
3
870
Ruby Trivia 2
sferik
0
830
💀 Symbols
sferik
5
2k
Content Negotiation for REST APIs
sferik
8
1.1k
Writing Fast Ruby
sferik
630
63k
Mutation Testing with Mutant
sferik
5
1.2k
Other Decks in Programming
See All in Programming
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
530
[BalkanRuby 2026] Drop your app/services!
palkan
3
660
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
1
940
inferと仲良くなる10分間
ryokatsuse
1
240
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
330
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
410
Modding RubyKaigi for Myself
yui_knk
0
420
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
230
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
190
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
110
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
300
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
180
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.4k
Building Applications with DynamoDB
mza
96
7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
190
Git: the NoSQL Database
bkeepers
PRO
432
67k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Music & Morning Musume
bryan
47
7.2k
Thoughts on Productivity
jonyablonski
76
5.2k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
BBQ
matthewcrist
89
10k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
Transcript
Ruby Trivia
In Ruby, a dash may not be used in a
variable name… …but before Ruby 2.1, one variable was allowed to be named with a dash. What was it called? Question 1:
In Ruby, a dash may not be used in a
variable name… …but before Ruby 2.1, one variable was allowed to be named with a dash. What was it called? Hint: It’s a global variable. Question 1:
$- Answer 1:
Why can’t variable names contain dashes? Bonus Question:
Why can’t variable names contain dashes? Bonus Question: Answer: Because
the Ruby parser can’t distinguish it from the minus (-) operator between two variables (e.g. forty-two).
Ruby may define a special File object in the first
file it interprets. What is it called? What does it do? Question 2:
Ruby may define a special File object in the first
file it interprets. What is it called? Question 2: Hint: When you call read, it reads the file, starting after __END__
DATA Answer 2:
What happens if you call: DATA.rewind before DATA.read Bonus Question:
What happens if you call: DATA.rewind before DATA.read Bonus Question:
Answer: It reads the entire file, including the source code.
The following line of code is valid Ruby syntax: a
= true && return But this line of code is not: a = return && true What is the error message? Question 3:
void value expression Answer 3:
When you convert the range: (1..3).to_a You get the array:
[1, 2, 3] What is the result of: (3..1).to_a Question 4:
[] Answer 4:
What method would need to be added to the Range
interface to make descending sequences possible? Bonus Question:
What method would need to be added to the Range
interface to make descending sequences possible? Bonus Question: Answer: pred (the opposite of succ).
What Ruby class mixes-in Comparable but doesn’t define the spaceship
(<=>) operator? Question 5:
What Ruby class mixes-in Comparable but doesn’t define the spaceship
(<=>) operator? Hint: It’s a descendant of Numeric. Question 5:
Complex Answer 5:
Thanks for playing! Follow @sferik on Twitter for more Ruby
trivia and practica.