Sha256: cb2258ba923fa4c12e85c83b3117bc086effb9cd42d3f1386c3f6a8eb96801a8
Contents?: true
Size: 495 Bytes
Versions: 11
Compression:
Stored size: 495 Bytes
Contents
# Allows Writing of 100.to_money for +Numeric+ types # 100.to_money => #<Money @cents=10000> # 100.37.to_money => #<Money @cents=10037> class Numeric def to_money(currency = nil) Money.new(self, currency) end end # Allows Writing of '100'.to_money for +String+ types # Excess characters will be discarded # '100'.to_money => #<Money @cents=10000> # '100.37'.to_money => #<Money @cents=10037> class String def to_money(currency = nil) Money.parse(self, currency) end end
Version data entries
11 entries across 11 versions & 1 rubygems