Skip to content

Commit acde7a9

Browse files
committed
Move to before setting up defaults
1 parent 1a38ba4 commit acde7a9

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

lib/money/money.rb

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def to_nearest_cash_value
106106

107107
# Class Methods
108108
class << self
109-
110109
# @!attribute [rw] default_bank
111110
# Used to set a default bank for currency exchange.
112111
#
@@ -163,7 +162,13 @@ class << self
163162
:conversion_precision,
164163
:strict_eql_compare
165164
attr_reader :locale_backend
166-
attr_writer :default_bank
165+
attr_writer :default_bank,
166+
:default_currency
167+
168+
# @attr_writer rounding_mode Use this to specify the rounding mode
169+
attr_writer :rounding_mode
170+
171+
alias_method :from_cents, :new
167172
end
168173

169174
# @!attribute default_currency
@@ -326,15 +331,6 @@ def self.from_dollars(amount, currency = default_currency, options = {})
326331
from_amount(amount, currency, options)
327332
end
328333

329-
class << self
330-
attr_writer :default_currency
331-
332-
# @attr_writer rounding_mode Use this to specify the rounding mode
333-
attr_writer :rounding_mode
334-
335-
alias_method :from_cents, :new
336-
end
337-
338334
# Creates a new Money object of value given in the
339335
# +fractional unit+ of the given +currency+.
340336
#

0 commit comments

Comments
 (0)