lib/money/bank/base.rb in money-3.1.0.pre1 vs lib/money/bank/base.rb in money-3.1.0.pre2

- old
+ new

@@ -39,9 +39,22 @@ # Returns the singleton instance of the Base bank. def self.instance @@singleton ||= self.new end + attr_reader :rounding_method + + # Initializes a new Money::Bank::Base object. An optional block can be + # passed to dictate the rounding method that +exchange_with+ can use. + def initialize(&block) + @rounding_method = block + setup + end + + # Called after initialize. Subclasses can use this method to setup + # variables, etc that they normally would in +#initialize+. + def setup + end # @deprecated +#exchange+ will be removed in v3.2.0, use +#exchange_with+ # # Exchanges the given amount of cents in +from_currency+ to +to_currency+. #