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
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
80
Actor Model
linjunpop
0
33
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
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
540
Claude Code Skill入門
mayahoney
0
150
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
1
230
AI活用のコスパを最大化する方法
ochtum
0
130
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
830
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
210
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
170
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
140
Codex の「自走力」を高める
yorifuji
0
1.1k
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
110
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
240
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
420
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
180
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
660
Odyssey Design
rkendrick25
PRO
2
540
The Spectacular Lies of Maps
axbom
PRO
1
610
Designing for humans not robots
tammielis
254
26k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
150
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
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