$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Lightweight Objects Seattle.rb
Search
pete higgins
March 05, 2013
Programming
1
84
Lightweight Objects Seattle.rb
pete higgins
March 05, 2013
Tweet
Share
More Decks by pete higgins
See All by pete higgins
Help Seattle.rb
phiggins
0
88
Rails Archeology
phiggins
2
120
Webmock
phiggins
0
76
Ruby Stdlib's Benchmark
phiggins
0
67
Rails Maintainance Headaches
phiggins
0
140
Hacking Ruby
phiggins
3
220
Cute Animals You've Never Heard Of
phiggins
0
480
Other Decks in Programming
See All in Programming
Cap'n Webについて
yusukebe
0
140
愛される翻訳の秘訣
kishikawakatsumi
3
330
chocoZAPサービス予約システムをNuxtで内製化した話
rizap_tech
0
160
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
820
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.2k
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
150
Go コードベースの構成と AI コンテキスト定義
andpad
0
130
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
250
これならできる!個人開発のすゝめ
tinykitten
PRO
0
110
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.7k
Featured
See All Featured
Done Done
chrislema
186
16k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
4 Signs Your Business is Dying
shpigford
186
22k
A Tale of Four Properties
chriscoyier
162
23k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
We Have a Design System, Now What?
morganepeng
54
7.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Transcript
Lightweight Objects Pete Higgins Seattle.rb
Me twitter: @pete_higgins github: @phiggins
Not me
Also not me
Me
Me
Me
Why? * Fast development * boilerplate == typos * less
typing, laziness
Hash/Array/etc * Familiar * Builtin * (Relatively) efficient * Do
a lot out of the box
Downsides * Bad at conveying purpose
OpenStruct
Configuration
Simple Stubs
Result/Status
Default is nil
Struct
Simple stubs
Result/Status
Downsides * Not much more work to just use a
class * Not easy to initialize with a hash
Struct creation
OpenStruct vs. Hash ¯\_( ツ )_/¯
Minitest::Mock
Questions? twitter: @pete_higgins github: @phiggins