Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Types and Refactoring

Types and Refactoring

A talk about types and refactoring I gave at Brighton Ruby 2014.

Penelope Phippen

July 21, 2014
Tweet

More Decks by Penelope Phippen

Other Decks in Technology

Transcript

  1. class Just def initialize(value) @value = value end def map(&blk)

    def value_or(x) Just.new(blk.call(@value)) @value end end end
  2. Use a null object to replace a nil if you

    know defaults at define time