Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
64
Actor Model
linjunpop
0
30
Ruby for iOS developer
linjunpop
0
1k
A brief introduction to GitHub
linjunpop
1
67
Test Driven Development
linjunpop
0
48
Other Decks in Programming
See All in Programming
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
380
関数実行の裏側では何が起きているのか?
minop1205
1
670
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
sbt 2
xuwei_k
0
250
connect-python: convenient protobuf RPC for Python
anuraaga
0
380
AIコーディングエージェント(skywork)
kondai24
0
150
AWS CDKの推しポイントN選
akihisaikeda
1
240
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1.2k
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
360
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
2.2k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
210
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Statistics for Hackers
jakevdp
799
230k
Facilitating Awesome Meetings
lara
57
6.7k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
4 Signs Your Business is Dying
shpigford
186
22k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
Building Applications with DynamoDB
mza
96
6.8k
How GitHub (no longer) Works
holman
316
140k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Practical Orchestrator
shlominoach
190
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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