Module: ZipCode::DB
- Defined in:
- lib/zipcode-db.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.default ⇒ Object
17 18 19 |
# File 'lib/zipcode-db.rb', line 17 def default @default ||= registry.values.first end |
.for(country) ⇒ Object
13 14 15 |
# File 'lib/zipcode-db.rb', line 13 def for(country) registry[country] end |
.register(country, database) ⇒ Object
21 22 23 24 |
# File 'lib/zipcode-db.rb', line 21 def register(country, database) database.extend ZipCode::DB registry[country] = database end |
.registry ⇒ Object
26 27 28 |
# File 'lib/zipcode-db.rb', line 26 def registry @registry ||= {} end |