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
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
640
Ruby Trivia 3
sferik
0
760
The Value of Being Lazy
sferik
3
860
Ruby Trivia 2
sferik
0
820
💀 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
Agentic Elixir
whatyouhide
0
420
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
300
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1.1k
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
How Swift's Type System Guides AI Agents
koher
0
310
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
4
1.3k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
440
AIエージェントで業務改善してみた
taku271
0
550
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
24
15k
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
170
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
Vibe NLP for Applied NLP
inesmontani
PRO
0
510
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
280
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Test your architecture with Archunit
thirion
1
2.2k
RailsConf 2023
tenderlove
30
1.4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
280
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
430
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
350
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Faster Mobile Websites
deanohume
310
31k
The Curious Case for Waylosing
cassininazir
0
320
The untapped power of vector embeddings
frankvandijk
2
1.7k
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.