David Heinemeier Hansson wrote:
> class Subscription # abstract
>     def price_with_discount
>         PRICE * 0.9
           self.class::PRICE * 0.9
>     end
> end
> 
> class BasicSubscription < Subscription
>     PRICE = 19
> end
> 
> class PlusSubscription < Subscription
>     PRICE = 49
> end

p BasicSubscription.new.price_with_discount # ==> 17.1

I'm not sure how this solution fares in ruby 2.0, which has new constant 
scoping rules. Anybody know?