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
Jun Lin
November 27, 2012
Programming
1
170
Ruby 2.0
A glance of Ruby 2.0
Jun Lin
November 27, 2012
Tweet
Share
More Decks by Jun Lin
See All by Jun Lin
A brief introduction to GenStage
linjunpop
1
48
Microservices
linjunpop
0
53
Actor Model
linjunpop
0
24
Ruby for iOS developer
linjunpop
0
990
A brief introduction to GitHub
linjunpop
1
64
Test Driven Development
linjunpop
0
41
Other Decks in Programming
See All in Programming
CSC509 Lecture 13
javiergs
PRO
0
110
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
210
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
150
Jakarta EE meets AI
ivargrimstad
0
200
初めてDefinitelyTypedにPRを出した話
syumai
0
420
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
C++でシェーダを書く
fadis
6
4.1k
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Ethereum_.pdf
nekomatu
0
470
Jakarta EE meets AI
ivargrimstad
0
670
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
It's Worth the Effort
3n
183
27k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Designing for Performance
lara
604
68k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Language of Interfaces
destraynor
154
24k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
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