Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/minting/mint/dsl/string.rb

Overview

Core extension: adds money-parsing helper to String.

Instance Method Summary collapse

Instance Method Details

#to_money(currency = nil) ⇒ Money

Parses self as a numeric string and creates a Money in the given currency.

Parameters:

  • currency (String, Symbol, Currency) (defaults to: nil)

    target currency

Returns:



9
# File 'lib/minting/mint/dsl/string.rb', line 9

def to_money(currency = nil) = Mint::Money.parse(self, currency)