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
92
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
OAuthからOIDCへ ― 認可の仕組みが認証に拡張されるまで
yamatai1212
0
100
[Keynote] What do you need to know about DevEx in 2025
salaboy
0
170
能登半島地震において デジタルができたこと・できなかったこと
ditccsugii
0
190
いまからでも遅くない!SSL/TLS証明書超入門(It's not too late to start! SSL/TLS Certificates: The Absolute Beginner's Guide)
norimuraz
0
230
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
43k
Findy Team+ QAチーム これからのチャレンジ!
findy_eventslides
0
110
Node.js 2025: What's new and what's next
ruyadorno
0
210
Git in Team
kawaguti
PRO
3
370
AIツールでどこまでデザインを忠実に実装できるのか
oikon48
6
3.4k
2025-10-09_プロジェクトマネージャーAIチャンス
taukami
0
130
Wasmのエコシステムを使った ツール作成方法
askua
0
160
能登半島地震で見えた災害対応の課題と組織変革の重要性
ditccsugii
0
740
Featured
See All Featured
Navigating Team Friction
lara
190
15k
Gamification - CAS2011
davidbonilla
81
5.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
The Language of Interfaces
destraynor
162
25k
Rails Girls Zürich Keynote
gr2m
95
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
33
2.3k
How GitHub (no longer) Works
holman
315
140k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
A Tale of Four Properties
chriscoyier
161
23k
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