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
J-_-L
November 03, 2012
Technology
2
91
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
Kiroから考える AIコーディングツールの潮流
s4yuba
4
670
AIエージェントを現場で使う / 2025.08.07 著者陣に聞く!現場で活用するためのAIエージェント実践入門(Findyランチセッション)
smiyawaki0820
6
730
Claude Codeは仕様駆動の夢を見ない
gotalab555
18
4.8k
S3 Glacier のデータを Athena からクエリしようとしたらどうなるのか/try-to-query-s3-glacier-from-athena
emiki
0
190
AI時代の経営、Bet AI Vision #BetAIDay
layerx
PRO
1
1.8k
【新卒研修資料】数理最適化 / Mathematical Optimization
brainpadpr
25
12k
反脆弱性(アンチフラジャイル)とデータ基盤構築
cuebic9bic
3
170
風が吹けばWHOISが使えなくなる~なぜWHOIS・RDAPはサーバー証明書のメール認証に使えなくなったのか~
orangemorishita
15
5.5k
金融サービスにおける高速な価値提供とAIの役割 #BetAIDay
layerx
PRO
1
750
LIFF CLIとngrokを使ったLIFF/LINEミニアプリのお手軽実機確認
diggymo
0
230
Strands Agents & Bedrock AgentCoreを1分でおさらい
minorun365
PRO
6
240
Vision Language Modelと自動運転AIの最前線_20250730
yuyamaguchi
3
1.2k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.8k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
540
For a Future-Friendly Web
brad_frost
179
9.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Invisible Side of Design
smashingmag
301
51k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
19k
Why Our Code Smells
bkeepers
PRO
337
57k
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