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
50
Microservices
linjunpop
0
54
Actor Model
linjunpop
0
26
Ruby for iOS developer
linjunpop
0
1k
A brief introduction to GitHub
linjunpop
1
65
Test Driven Development
linjunpop
0
43
Other Decks in Programming
See All in Programming
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
230
コードを読んで理解するko build
bells17
1
120
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
9
1.6k
Jakarta EE meets AI
ivargrimstad
0
750
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
140
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
300
技術を改善し続ける
gumioji
0
180
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
270
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
170
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
260
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
700
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
180
Featured
See All Featured
Designing for Performance
lara
605
68k
Typedesign – Prime Four
hannesfritz
41
2.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
The Cult of Friendly URLs
andyhume
78
6.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1.1k
A Tale of Four Properties
chriscoyier
158
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
115
51k
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