Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class Money def initialize(amount) @amount = amount end end class Integer VALID_CURRENCIES = [:kroner, :dollar, :euro] def method_missing(m, *args, &proc) if VALID_CURRENCIES.include?(m.to_sym) Money.new(self) else super end end end 10.kroner # => en instans av Money 10.kurdere # => NoMethodError: undefined method ‘kurdere’ for 10:Fixnum
This paste will be private.
From the Design Piracy series on my blog: