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
64
Microservices
linjunpop
0
93
Actor Model
linjunpop
0
38
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
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
53
34k
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
330
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
200
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
250
信頼性の目標を誰も求めてない
shubox
0
480
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
110
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
310
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
130
バグを直したら useEffect が消えた
colorful12
3
830
Flow は今どうなっているか
mizdra
PRO
0
880
高専キャリア LT 発表内容
crysta1221
6
5.5k
Featured
See All Featured
Designing for Performance
lara
611
70k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Unsuck your backbone
ammeep
672
58k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
ラッコキーワード サービス紹介資料
rakko
1
4.7M
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Building Adaptive Systems
keathley
44
3.2k
A Modern Web Designer's Workflow
chriscoyier
698
190k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
840
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
510
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
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