hexorx/countries — pull request #78 by guyboertje (2013-07-09 18:06:58+00:00)
Title: Changes to the country method and correct or supply some missing currencies

I suppose the main issue you will have is with the refactored currency method. I'll explain my thinking.

The AttrReader mechanism defines a currency reader method first, then it is redefined. Perhaps the reader method should have been aliased so one can still get access to the attribute. However there will be a lot of code out there that uses the second method, so it should return something instead of depending on the Currency gem to be in sync.

I chose to use a CurrencyProxy Struct instead of using an instance of ISO4217::Currency so that one can detect the difference in returned object if needs be.

I set the currency of Antartica to AUD (because Australia seems to have the biggest slice of it), arguably this is not correct. However many test suites use random selections for countries, causing failures when the currency method returns nil.