Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
value_struct
Search
J-_-L
November 03, 2012
Technology
110
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
value_struct
5-min introduction to read-only structs in Ruby
J-_-L
November 03, 2012
More Decks by J-_-L
See All by J-_-L
Why Ruby is "beautiful code"!
janlelis
2
2.3k
Other Decks in Technology
See All in Technology
V8コントリビュート超入門
riyaamemiya
0
160
アリアドネの糸と、20年ごとの建て替え ── 長尾真『電子図書館』を、伊勢で読み直す / Rereading Makoto Nagao’s "Electronic Library" in Ise
ykiyota
0
120
Podは生きているのにGoだけが落ちる:GOGCとGOMEMLIMITで追うInvisible OOM Killの謎
tkc66buzz
1
220
Azure Cost Management の FOCUS コストデータを迷わず読むための“3つの軸”
tetsuyaooooo
0
160
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
250
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
110
現場に行くだけでは足りない——プロダクトエンジニアが業務の流れを捉える観点と、その鍛え方
takumiengineering
0
350
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
0
1.1k
ASTを使って影響範囲を特定する
nealle
0
120
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
420
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
130
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
220
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The SEO Collaboration Effect
kristinabergwall1
1
550
Mind Mapping
helmedeiros
1
350
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
730
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.7k
Transcript
1/6 rbjl.net ValueStruct - Nov 3 2012 - Jan Lelis
d:evolute @happycode
2/6 rbjl.net ValueStruct Value structs behave like a normal Ruby
structs However, they are immutable*
3/6 rbjl.net ValueStruct: First Draft
4/6 rbjl.net ValueStruct: Benchmarks • Without mixins not much slower
than Struct
5/6 rbjl.net ValueStruct: Optional mixins • #dup takes a optional
hash for setting new values • Value structs can be initialized with the exact amount of arguments • Automatically freeze new instances • #to_h for converting into a hash • If Ruby version below 2.0
6/6 rbjl.net ValueStruct: Resources • gem install value_struct • https://github.com/janlelis/value_struct
• Other solutions • https://github.com/tcrayford/Values • https://github.com/iconara/immutable_struct • Twitter • @happycode • Contact • happycode.org / devolute.org