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
53
Microservices
linjunpop
0
58
Actor Model
linjunpop
0
29
Ruby for iOS developer
linjunpop
0
1k
A brief introduction to GitHub
linjunpop
1
66
Test Driven Development
linjunpop
0
48
Other Decks in Programming
See All in Programming
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
790
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
420
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
310
GraphQL×Railsアプリのデータベース負荷分散 - 月間3,000万人利用サービスを無停止で
koxya
1
1.2k
CSC509 Lecture 03
javiergs
PRO
0
330
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
1.2k
チームの境界をブチ抜いていけ
tokai235
0
140
Devvox Belgium - Agentic AI Patterns
kdubois
1
100
クラシルを支える技術と組織
rakutek
0
200
Serena MCPのすすめ
wadakatu
4
950
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.2k
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
210
Featured
See All Featured
Optimizing for Happiness
mojombo
379
70k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
A better future with KSS
kneath
239
18k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Thoughts on Productivity
jonyablonski
70
4.9k
A Modern Web Designer's Workflow
chriscoyier
697
190k
How GitHub (no longer) Works
holman
315
140k
Side Projects
sachag
455
43k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
19
1.2k
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