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

The Bipolar Programmer

The Bipolar Programmer

My StarTechConf 2013 talk

Jano González

October 26, 2013
Tweet

More Decks by Jano González

Other Decks in Programming

Transcript

  1. THINKER class AccountProtectionProxy def initialize(real_account, owner) @subject = real_account @owner

    = owner end ! def method_missing(name, *args) check_access @subject.send(name, *args) end ...
  2. EXAMPLE case account_type when :premium then # do stuff when

    :standard then # do stuff when :personal then # do stuff end
  3. EXAMPLE class PremiumAccount def initialize # do stuff end !

    def execute(context) # do stuff end end