From: Chad Perrin Date: 2012-01-24T02:38:09+09:00 Subject: Re: Microrant on Ruy's Math Skills On Mon, Jan 23, 2012 at 08:38:56PM +0900, Peter Vandenabeele wrote: > > Thanks for the idea. > > I fixed my feature request with this code in > a library file: > > require 'bigdecimal' > class ::String > def to_bd > BigDecimal.new(self) > end > end > > So it only works on strings (that's what I want). > > Now I can say: > > describe "balance setter and getter" do > subject.balance = "15.4".to_bd > subject.balance.should == "15.4".to_bd > end Is there any reason this would not be better done with symbols than with strings? -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]