~/talk

Designing A Great Ruby API

Talkat RubyConf Portugal 2015 · 2015-09-14..09-15· [api-design, ruby]
slides:none on file

Rails adds an attributes API that extracts typecasting out of ad‑hoc attribute reader/writer overrides into explicit type objects and an AttributeSet, letting models declare or lazily override attribute types without hacking columns. The implementation composes decorators (used for serialize and time zone conversion), fixes mutation detection so dirty tracking behaves correctly, and makes concrete guarantees (save/reload and assigning the same value don’t flip changed state). Most legacy hacks are removed and the API ships in Rails 5.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:02Identifying the problem to solve
  3. 3:56Problems with current attribute overrides
  4. 11:21Defining typecasting and type coercion
  5. 15:46Starting the API design process
  6. 17:57Introducing the type object
  7. 21:06Writing tests for the new API
  8. 23:57Avoiding DSL complexity
  9. 26:24Lazy vs strict API representations
  10. 29:17Decorators and type modification
  11. 32:11Simplifying serialize with the new API
  12. 33:38Making the API universal
  13. 35:48Performance considerations in API design
  14. 36:55Composition over inheritance
  15. 37:59Establishing API contracts
  16. 39:25Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.