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

Version Path
shopify-money-0.14.1 lib/money/core_extensions.rb
shopify-money-0.14.0 lib/money/core_extensions.rb
shopify-money-0.13.1 lib/money/core_extensions.rb
shopify-money-0.13.0 lib/money/core_extensions.rb
shopify-money-0.12.0 lib/money/core_extensions.rb
shopify-money-0.11.9 lib/money/core_extensions.rb
shopify-money-0.11.8 lib/money/core_extensions.rb
shopify-money-0.11.7 lib/money/core_extensions.rb
shopify-money-0.11.6 lib/money/core_extensions.rb
shopify-money-0.11.5 lib/money/core_extensions.rb
shopify-money-0.11.4 lib/money/core_extensions.rb