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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
J-_-L
November 03, 2012
Technology
2
96
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
Tebiki Engineering Team Deck
tebiki
0
24k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.7k
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
120
使いにくいの壁を突破する
sansantech
PRO
1
130
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.6k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
42k
今日から始めるAmazon Bedrock AgentCore
har1101
4
400
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
210
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
Context Engineeringの取り組み
nutslove
0
320
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.7k
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
51
Accessibility Awareness
sabderemane
0
51
We Are The Robots
honzajavorek
0
160
GitHub's CSS Performance
jonrohan
1032
470k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Balancing Empowerment & Direction
lara
5
880
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
WENDY [Excerpt]
tessaabrams
9
36k
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