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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
730
Ruby Trivia 3
sferik
0
790
The Value of Being Lazy
sferik
3
880
Ruby Trivia 2
sferik
0
840
💀 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 Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.4k
AIが無かった頃の素敵な出会いの話
codmoninc
1
390
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
490
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
400
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.6k
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
300
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
HDC tutorial
michielstock
2
790
Being A Developer After 40
akosma
91
590k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
400
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
930
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
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.