Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sunny Ripert <[email protected]>
  • Loading branch information
sirwolfgang and sunny committed May 16, 2024
1 parent a6389d0 commit 31fb82d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/money/money.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def self.from_amount(amount, currency = default_currency, options = {})
raise ArgumentError, "'amount' must be numeric" unless Numeric === amount

currency = Currency.wrap(currency) || Money.default_currency
raise Currency::NoCurrency, 'must be provide a currency' if currency.nil?
raise Currency::NoCurrency, 'must provide a currency' if currency.nil?

value = amount.to_d * currency.subunit_to_unit
new(value, currency, options)
Expand Down Expand Up @@ -356,7 +356,7 @@ def initialize(obj, currency = Money.default_currency, options = {})

# BigDecimal can be Infinity and NaN, money of that amount does not make sense
raise ArgumentError, 'must be initialized with a finite value' unless @fractional.finite?
raise Currency::NoCurrency, 'must be provide a currency' if @currency.nil?
raise Currency::NoCurrency, 'must provide a currency' if @currency.nil?
end

# Assuming using a currency using dollars:
Expand Down

0 comments on commit 31fb82d

Please sign in to comment.