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
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
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
組織で育むオブザーバビリティ
ryota_hnk
0
170
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
CSC307 Lecture 08
javiergs
PRO
0
670
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
dchart: charts from deck markup
ajstarks
3
990
Fluid Templating in TYPO3 14
s2b
0
130
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
CSC307 Lecture 05
javiergs
PRO
0
500
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1k
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
The Curious Case for Waylosing
cassininazir
0
230
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
110
Google's AI Overviews - The New Search
badams
0
900
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Language of Interfaces
destraynor
162
26k
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