moolah 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 115af710c730393a90c68062b1ab169762039a21262e37436253903bd212c6fd
4
- data.tar.gz: '06296e3e90b8d761400150bb5338dcf442fa5b84efde22bc9b83d56146dfe9a9'
3
+ metadata.gz: a2da115bb4dda298972fa96865bb4ed3fc1d19804a0cf8c958c5b42af3136dfa
4
+ data.tar.gz: 662d6e21e8e2fdbd51d08f5dc87d657e667a45d261c1327259e96ff9c4106df0
5
5
  SHA512:
6
- metadata.gz: 2625001e06725cef62bb406554c015606fbbf82679d039d74bd715432ec9312b6fa0b07b3496dba4853539ee26bdaad17017d243a088656a9925268ceb09a381
7
- data.tar.gz: 34fa35fde5cfd8819cddf8ce89c88509ad6989b73a89e147f8c1f34cfcf03f0119a2f4c72505cf610a041adc93ca8b059324d1900df957628aa8c3de0b034f04
6
+ metadata.gz: 6bda8b4e7dffbf8ac27d0595436c73a598376ee217190a4a2741e4873bfe4c2c1b475d4102aa7e5c8e1181185fa2803e8a0186e995311d3e7721dbbde55014e6
7
+ data.tar.gz: 3482d8f55571ec7a0d7f08c8c64d97eca27c2b8d60e42c0f9de5daf90c2901eb9d925367b3f30eaa75ae682b70ab4c6f4ee59b2a5941404269d60d508e390c64
data/lib/moolah/money.rb CHANGED
@@ -7,10 +7,11 @@ module Moolah
7
7
  include Comparable
8
8
 
9
9
  attribute :amount, BigDecimal, default: BigDecimal(0)
10
- attribute :currency, String, default: 'AUD'
10
+ attribute :currency, String
11
11
  attribute :fx_rate, BigDecimal
12
12
 
13
13
  def initialize(args = {})
14
+ args[:currency] = 'AUD' if args[:currency].nil? || args[:currency] == ''
14
15
  args[:fx_rate] = 1.0 if args[:currency] == 'AUD'
15
16
 
16
17
  raise ArgumentError.new('missing keyword: :fx_rate') unless args[:fx_rate]
@@ -1,6 +1,6 @@
1
1
  module Moolah
2
2
  MAJOR = 5
3
- MINOR = 0
3
+ MINOR = 1
4
4
  PATCH = ENV['PATCH_VERSION'] || 0
5
5
 
6
6
  private_constant :MAJOR, :MINOR, :PATCH
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moolah
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Lee