Designing a Great Ruby API - How We're Simplifying Rails 5
summary
Describes designing and shipping a concrete replacement for ad hoc attribute casting in Rails by extracting a reusable type object, adding lazy and strict APIs, and layering attribute decorator and attribute collection objects to replace the giant case statements that lived on the columns hash. Tests guide incremental refactors, many changes land in 4.2 with the API becoming public in Rails 5, bugs drop significantly, and performance stays roughly the same after eliminating string-keyed hashes and consolidating behavior.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:45Identifying Holes in Your API
- 4:13Warning! Rails Internals Ahead Not for the faint of heart!
- 15:48Implement in small steps
- 17:02Separate lazy from strict
- 21:57Make your API universal There should be one canonical way to access things
related talks
41mDesigning A Great Ruby API
19mAn ActiveRecord Rewrite: the Story Behind the Attributes API
24mRails 5 Features You Haven't Heard About
34mRails 5 Features You Haven't Heard About
53mRuby 2 in Ruby on Rails
42mBuilding Better Web APIs with Rails
32mFast, Testable and SANE APIs
26mThe process of building APIs
