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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
720
Ruby Trivia 3
sferik
0
780
The Value of Being Lazy
sferik
3
880
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
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
130
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
230
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
160
AIで効率化できた業務・日常
ochtum
0
140
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
560
A2UI という光を覗いてみる
satohjohn
1
150
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
400
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
120
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
Oxlintのカスタムルールの現況
syumai
6
1.1k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
55k
Test your architecture with Archunit
thirion
1
2.3k
Faster Mobile Websites
deanohume
310
32k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Unsuck your backbone
ammeep
672
58k
WENDY [Excerpt]
tessaabrams
11
38k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
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.