$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
value_struct
Search
J-_-L
November 03, 2012
Technology
2
93
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
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
340
ガバメントクラウド利用システムのライフサイクルについて
techniczna
0
190
Gemini でコードレビュー知見を見える化
zozotech
PRO
1
240
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
450
Sansanが実践する Platform EngineeringとSREの協創
sansantech
PRO
2
780
エンジニアとPMのドメイン知識の溝をなくす、 AIネイティブな開発プロセス
applism118
4
1.2k
Playwright x GitHub Actionsで実現する「レビューしやすい」E2Eテストレポート
kinosuke01
0
550
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
800
学習データって増やせばいいんですか?
ftakahashi
2
300
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
4
1.3k
多様なデジタルアイデンティティを攻撃からどうやって守るのか / 20251212
ayokura
0
420
【AWS re:Invent 2025速報】AIビルダー向けアップデートをまとめて解説!
minorun365
4
500
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Site-Speed That Sticks
csswizardry
13
1k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
It's Worth the Effort
3n
187
29k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
GraphQLとの向き合い方2022年版
quramy
50
14k
Writing Fast Ruby
sferik
630
62k
Speed Design
sergeychernyshev
33
1.4k
Automating Front-end Workflow
addyosmani
1371
200k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
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