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
value_struct
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
J-_-L
November 03, 2012
Technology
2
96
value_struct
5-min introduction to read-only structs in Ruby
J-_-L
November 03, 2012
Tweet
Share
More Decks by J-_-L
See All by J-_-L
Why Ruby is "beautiful code"!
janlelis
2
2.2k
Other Decks in Technology
See All in Technology
Agile Leadership Summit Keynote 2026
m_seki
1
410
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
350
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
410
Meshy Proプラン課金した
henjin0
0
250
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
240
MySQLのJSON機能の活用術
ikomachi226
0
150
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.3k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.6k
(金融庁共催)第4回金融データ活用チャレンジ勉強会資料
takumimukaiyama
0
120
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.3k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
66k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Building the Perfect Custom Keyboard
takai
2
680
[SF Ruby Conf 2025] Rails X
palkan
0
740
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
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