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 2.0
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Jun Lin
November 27, 2012
Programming
170
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby 2.0
A glance of Ruby 2.0
Jun Lin
November 27, 2012
More Decks by Jun Lin
See All by Jun Lin
A brief introduction to GenStage
linjunpop
1
60
Microservices
linjunpop
0
92
Actor Model
linjunpop
0
37
Ruby for iOS developer
linjunpop
0
1k
A brief introduction to GitHub
linjunpop
1
72
Test Driven Development
linjunpop
0
54
Other Decks in Programming
See All in Programming
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
210
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
480
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.7k
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
340
共通化で考えるべきは、実装より公開する型だった
codeegg
0
270
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
230
yield再入門 #phpcon
o0h
PRO
0
690
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.9k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
150
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Discover your Explorer Soul
emna__ayadi
2
1.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
350
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
510
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
Claude Code のすすめ
schroneko
67
230k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
470
Become a Pro
speakerdeck
PRO
31
6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
BBQ
matthewcrist
89
10k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
The Cost Of JavaScript in 2023
addyosmani
55
10k
Transcript
Ruby 2.0
February 24th 2013
Ruby’s 20th birthday.
Faster
Reliable
More fun to use
REFINEMENTS
• A mechanism to extend Classes and Modules locally •
Lexically scoped • Safer and cleaner than open-class monkey patching
• Module#refine • Kernel#using
module Foo refine String do def say "Yoho, #{self}!" end
end end class Bar using Foo def aloha 'Bar'.say end end
Bar.new.aloha => “Yoho, Bar!”
PREPEND
Module#prepend
class A def foo 'foo' end end module B def
foo super + 'bar' end end class C < A prepend B def foo super + 'COOL' end end
C.new.foo => “fooCOOLbar”
LAZY
Enumerator#lazy
(1..Float::INFINITY).lazy.select(&:even?).take(20).force
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
22, 24, 26, 28, 30, 32, 34, 36, 38, 40]
KEYWORD ARGUMENT
class Bar def foo(a: "foo", b: 424242) [a, b] end
end
Bar.new.foo => ['foo', 424242]
2.0.0-preview1
END