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
160
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
41
Microservices
linjunpop
0
53
Actor Model
linjunpop
0
20
Ruby for iOS developer
linjunpop
0
980
A brief introduction to GitHub
linjunpop
1
60
Test Driven Development
linjunpop
0
41
Other Decks in Programming
See All in Programming
Domain-Driven Transformation
hschwentner
2
1.5k
禅の心を手に入れよ
eltociear
1
280
Goのエラースタックトレースの歴史と今後
sonatard
10
1.7k
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
410
PostmanでAPIの動作確認が楽になった話
h455h1
0
180
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
210
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1.1k
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
970
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
380
新宿ダンジョンを可視化してみた
satoshi7190
3
350
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
100
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
Featured
See All Featured
Statistics for Hackers
jakevdp
790
220k
Unsuck your backbone
ammeep
663
57k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.2k
The Mythical Team-Month
searls
216
42k
From Idea to $5000 a Month in 5 Months
shpigford
378
45k
Embracing the Ebb and Flow
colly
80
4.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
Web development in the modern age
philhawksworth
203
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
Designing for Performance
lara
602
67k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
7
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
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