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
89
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
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
860
PaaSの歴史と、 アプリケーションプラットフォームのこれから
jacopen
7
1.5k
メールヘッダーを見てみよう
hinono
0
110
技術に触れたり、顔を出そう
maruto
1
150
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
今年一年で頑張ること / What I will do my best this year
pauli
1
220
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.4k
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
280
re:Invent 2024のふりかえり
beli68
0
110
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
360
Featured
See All Featured
A Tale of Four Properties
chriscoyier
157
23k
Building Applications with DynamoDB
mza
93
6.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
Unsuck your backbone
ammeep
669
57k
A Philosophy of Restraint
colly
203
16k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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