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
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
猫付きpingコマンドを自作
uyuki234
0
220
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
制約理論(ToC)入門 2026版
recruitengineers
PRO
8
2.2k
事業価値と Engineering 2026年度版
recruitengineers
PRO
49
23k
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.1k
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
260
Flutterをカメラで動かしたかった話
sony
1
140
【CEDEC2026】専門性の高いデフォルメチームが挑んだ人材育成戦略 〜Cygames Academiaの企画から実施まで〜
cygames
PRO
0
570
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
FDEの心得
noriakioji
4
4.7k
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
250
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
460
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Statistics for Hackers
jakevdp
799
230k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Mind Mapping
helmedeiros
PRO
1
310
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
590
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
460
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