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
52
Microservices
linjunpop
0
56
Actor Model
linjunpop
0
27
Ruby for iOS developer
linjunpop
0
1k
A brief introduction to GitHub
linjunpop
1
66
Test Driven Development
linjunpop
0
44
Other Decks in Programming
See All in Programming
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
1
220
エンジニアのための”最低限いい感じ”デザイン入門
shunshobon
0
110
CLI ツールを Go ライブラリ として再実装する理由 / Why reimplement a CLI tool as a Go library
ktr_0731
3
1.1k
Android 15以上でPDFのテキスト検索を爆速開発!
tonionagauzzi
0
200
Infer入門
riru
4
1.5k
生成AI、実際どう? - ニーリーの場合
nealle
0
110
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
140
Go製CLIツールをnpmで配布するには
syumai
2
1.2k
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
1
120
新世界の理解
koriym
0
140
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
180
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
670
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
GitHub's CSS Performance
jonrohan
1031
460k
We Have a Design System, Now What?
morganepeng
53
7.7k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building Adaptive Systems
keathley
43
2.7k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Bash Introduction
62gerente
614
210k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
8
560
Faster Mobile Websites
deanohume
309
31k
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