module Money::Parse

Defined in:

money/money/parse.cr

Instance Method Summary

Instance Method Detail

def parse(str : String, *, allow_ambiguous = true) : Money #

Creates a Money instance from a string.

If allow_ambiguous is true (default), returns the first matching currency for ambiguous values, otherwise raises Error.


[View source]
def parse?(str : String, *, allow_ambiguous = true) : Money | Nil #

Creates a Money instance from a string, or returns nil on failure.

If allow_ambiguous is true (default), returns the first matching currency for ambiguous values, otherwise returns nil.


[View source]