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
87
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.1k
Other Decks in Technology
See All in Technology
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
530
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
590
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
200
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
フルカイテン株式会社 採用資料
fullkaiten
0
40k
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
150
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Thoughts on Productivity
jonyablonski
67
4.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
What's new in Ruby 2.0
geeforr
343
31k
Embracing the Ebb and Flow
colly
84
4.5k
Making Projects Easy
brettharned
115
5.9k
A better future with KSS
kneath
238
17k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
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