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

Don't Get Clever

avdi
July 20, 2013
340

Don't Get Clever

Part of the Ruby Rogues live panel episode at Lone Star Ruby Conference 2013.

avdi

July 20, 2013
Tweet

Transcript

  1. Pop quiz r e q u i r e '

    p s t o r e ' s t o r e = P S t o r e . n e w ( ' d a t a . p s t o r e ' ) s t o r e . t r a n s a c t i o n ( t r u e ) d o # . . . e n d
  2. Pop quiz 2 A r r a y . i

    n s t a n c e _ m e t h o d s ( f a l s e )
  3. Symbols are truthy r e q u i r e

    ' p s t o r e ' s t o r e = P S t o r e . n e w ( ' d a t a . p s t o r e ' ) s t o r e . t r a n s a c t i o n ( : r e a d _ o n l y ) d o # . . . e n d
  4. What's : r e a d _ o n l

    y ?? s t o r e . t r a n s a c t i o n ( : r e a d _ o n l y ) d o # . . . e n d
  5. Dead end s t o r e . t r

    a n s a c t i o n ( : c h u n k y _ b a c o n ) d o # . . . e n d
  6. Negation A r r a y . i n s

    t a n c e _ m e t h o d s ( ! : i n c l u d e _ s u p e r )
  7. Intention-revealing argument r e a d _ o n l

    y = t r u e s t o r e . t r a n s a c t i o n ( r e a d _ o n l y ) d o # . . . e n d
  8. Intention-revealing argument i n c l u d e _

    s u p e r = f a l s e A r r a y . i n s t a n c e _ m e t h o d s ( i n c l u d e _ s u p e r )
  9. Inline version A r r a y . i n

    s t a n c e _ m e t h o d s ( i n c l u d e _ s u p e r = f a l s e )