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 ]