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.1 Overview
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jesse Wolgamott
January 15, 2014
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby 2.1 Overview
(For HoustonRB)
Jesse Wolgamott
January 15, 2014
More Decks by Jesse Wolgamott
See All by Jesse Wolgamott
React vs React-Native
jwo
0
150
What is an API
jwo
0
220
DIY Rails Authentication
jwo
0
240
ActionCable - For Not Another Chat App
jwo
3
1.8k
SlackBot.rb - Create You a Slack Bot
jwo
1
1.5k
react-rails: an isomorphic match made in heaven
jwo
0
1.4k
Docker - next big thing
jwo
0
1k
Rails 4: Appetizers
jwo
1
1.1k
The Long Ball: Upgrading Rails from 1.2 -> 4.0
jwo
2
220
Other Decks in Technology
See All in Technology
RSA暗号を手計算したくなること、ありますよね?? (20260615_orestudy6_rsa)
thousanda
0
370
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
150
やさしいA2A入門
minorun365
PRO
12
1.8k
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
960
LLMにもCAP定理があるという話
harukasakihara
0
330
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
740
MCP Appsを作ってみよう
iwamot
PRO
4
610
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1.1k
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
21
6.8k
自律型AIエージェントは何を破壊するのか
kojira
0
160
NAB Show 2026 動画技術関連レポート / NAB Show 2026 Report
cyberagentdevelopers
PRO
0
190
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
660
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Paper Plane (Part 1)
katiecoart
PRO
0
8.9k
Statistics for Hackers
jakevdp
799
230k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
850
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
390
The Spectacular Lies of Maps
axbom
PRO
1
800
Documentation Writing (for coders)
carmenintech
77
5.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Context Engineering - Making Every Token Count
addyosmani
9
960
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
Transcript
@jwo Ruby 2.1
@jwo `def` returns a method
@jwo module Foo! def public_method! end! ! def some_other_method! end!
! private :some_other_method! ! private! def a_private_method! end! end! ! Foo.private_instance_methods! => [:some_other_method, :a_private_method]
@jwo module Foo! def public_method! end! ! private def some_other_method!
end! ! private def a_private_method! end! end! ! Foo.private_instance_methods! => [:some_other_method, :a_private_method]
@jwo Refinements Launched and the world did not end.
@jwo module Permalinker! refine String do! def permalinkify! downcase.split.join("-")! end!
end! end
@jwo class Post! using Permalinker! ! def initialize(title)! @title =
title! end! ! def permalink! @title.permalinkify! end! end
@jwo "Refinements are not globally scoped".permalinkify! ! ! ! NoMethodError:
undefined method `permalinkify' for "Refinements are not globally scoped":String
@jwo Restricted Keyword Args
@jwo def order_tacos(type: 5, how_many: 'queso')! puts "Ordering #{how_many} #{type}"!
end! ! order_tacos type: "fajita_queso", how_many: 5 in Ruby 2.0, you HAD to specify a default for type and how_many
@jwo def order_tacos(type:, how_many:)! puts "Ordering #{how_many} #{type}"! end! !
order_tacos type: "fajita_queso", how_many: 5! order_tacos type: “fajita_queso"! ! => ArgumentError: missing keyword: how_many NO LONGER
@jwo Restricted Generational Garbage Collector (RGENGC)
@jwo ummm wat
@jwo Ruby 1.8: Mark and Sweep http://tmm1.net/ruby21-rgengc/
@jwo Ruby 1.9.3 “Lazy Sweep” http://tmm1.net/ruby21-rgengc/
@jwo Ruby 2.0 bitmaps for copy-on-write safety http://tmm1.net/ruby21-rgengc/
@jwo Ruby 2.1: OldGen and minor marking http://tmm1.net/ruby21-rgengc/
@jwo Some Graphs!
@jwo Some Little Stuff
@jwo 27r # => Rational(27/1)! 1/2r # => Rational(1/2)! 12+33i
# => Complex(12,33) Decimal Literal Syntax
@jwo 3.times{puts'blah'.object_id}! # => 70287241728160! # => 70287241728080! # =>
70287241728020! ! 3.times{puts'blah'f.object_id}! # => 70287241709760 ! # => 70287241709760! # => 70287241709760 Frozen String Literal (Same)
@jwo $ stackprof data/stackprof-cpu-4120-1384979644.dump --text --limit 4 ================================== Mode: cpu(1000)
Samples: 9145 (1.25% miss rate) GC: 448 (4.90%) ================================== TOTAL (pct) SAMPLES (pct) FRAME 236 (2.6%) 231 (2.5%) String#blank? 546 (6.0%) 216 (2.4%) ActiveRecord::ConnectionAdapters::Mysql2Adapter#select 212 (2.3%) 199 (2.2%) Mysql2::Client#query_with_timing ! $ stackprof data/stackprof-cpu-4120-1384979644.dump --method 'String#blank?' String#blank? (lib/active_support/core_ext/object/blank.rb:80) samples: 231 self (2.5%) / 236 total (2.6%) callers: 112 ( 47.5%) Object#present? code: | 80 | def blank? 187 (2.0%) / 187 (2.0%) | 81 | self !~ /[^[:space:]]/ Profiling Tools (rb_profile_frames)
@jwo Install today!