…index from bank’s export/import. * RatesStore#each_rate returns Enumerator used by Bank’s export_data method. * RateStore::Memory mutex flag is passed on initialisation, not on every call to #add_rate and #get_rate. Defaults to thread-safe. * RateStore::Memory and Bank::VariableExchange happen to index / export data with “_TO_” separator, but these two clases should not about eachother’s internal serialisation.
Bank::VariableExchange doesn’t know anything about mutexes (that’s the Store’s job).
…::Memory. VariableExchange uses that store by default. This allows us to swap the storage mechanism (i.e. Redis, memcache, database, file, etc) without losing the behaviour in VariableExchange, or having to subclass or re-implement it. Composition > Inheritance. RatesStore::Memory only deals in currency iso codes: type checking and coercing stops at the bank. Removed testing of private #rate_key_for method. Todo: * do not test instance variables! (@mutex). Find a better way to test thread-safety. * move thread-safety tests to store tests. Bank doesn’t need to know about it.
A special circumstance for #== to recognize that the value of 0 money will also equal 0 in any other currency.
…e same, and no longer raises an error if one of the priorities is missing.
a currency without an iso_code. Fixing README: iso_code isn't optional
I had to move the methods inside the self << class block to get access to 'alias_method'
This means that we now have an easy way to catch all money & currency parsing errors (via [ArgumentError]).
Update currency_iso.json Update formatting_spec.rb Update CHANGELOG.md Update CHANGELOG.md Update AUTHORS Added myself and sorted a little :)
According to [Wikipedia] and [XE], the "руб" symbol is more commonly used. Also added the "₽" symbol as an alternate, because it was only added to Unicode this year and probably isn't widely supported yet. : http://en.wikipedia.org/wiki/Russian_ruble#Currency_symbol : http://www.xe.com/symbols.php
…egative amounts of money