alexrabarts / iso_country_codes

A Ruby library that provides ISO 3166-1 country codes/names and ISO 4217 currencies
http://github.com/alexrabarts/iso-country-codes
163 stars 62 forks source link

Country codes read in from yml? Extensible gem? #2

Closed vraravam closed 10 years ago

vraravam commented 12 years ago

Would it be possible to change iso_4217.rb and iso_3166_1.rb such that the values are read in from a yml file? Doing that and allowing any key for the property names (using method_missing or defining methods based on the attribute keys that are read in from the yaml file - instead of hard-coded method names in the ruby class) will allow the following:

The yml file could then be "externalized" to the consumer (you will need to provide a way for the gem consumer to specify a custom yml file) - ie they can take the default, add new attributes (for eg, in my case, I would like a "flag_sprite_class", "phone_code", "enabled"). Extending the gem will be super-easy in this case! What do you think?

benjaminwood commented 10 years ago

This is a good idea.

alexrabarts commented 10 years ago

There hasn't been much discussion around this issue so closing for now. I think it's beyond the scope of the gem.