Module: KeCounties
- Defined in:
- lib/ke_counties.rb,
lib/ke_counties/version.rb,
lib/ke_counties/counties.rb
Defined Under Namespace
Classes: Counties
Constant Summary collapse
- VERSION =
"0.0.3"
Class Method Summary collapse
- .abbr(cty) ⇒ Object
- .abbrvs ⇒ Object
- .all ⇒ Object
- .capital(cty) ⇒ Object
- .code(cty) ⇒ Object
- .codes ⇒ Object
- .content ⇒ Object
- .names ⇒ Object
- .province(cty) ⇒ Object
Class Method Details
.abbr(cty) ⇒ Object
19 20 21 |
# File 'lib/ke_counties.rb', line 19 def abbr(cty) counties.dig(cty, :abbrv) end |
.abbrvs ⇒ Object
35 36 37 |
# File 'lib/ke_counties.rb', line 35 def abbrvs content.map{ |i| i[:abbrv]} end |
.all ⇒ Object
7 8 9 |
# File 'lib/ke_counties.rb', line 7 def all counties end |
.capital(cty) ⇒ Object
23 24 25 |
# File 'lib/ke_counties.rb', line 23 def capital(cty) counties.dig(cty, :capital) end |
.code(cty) ⇒ Object
15 16 17 |
# File 'lib/ke_counties.rb', line 15 def code(cty) counties.dig(cty, :code) end |
.codes ⇒ Object
31 32 33 |
# File 'lib/ke_counties.rb', line 31 def codes content.map{ |i| i[:code]} end |
.content ⇒ Object
39 40 41 |
# File 'lib/ke_counties.rb', line 39 def content counties.values end |
.names ⇒ Object
11 12 13 |
# File 'lib/ke_counties.rb', line 11 def names counties.keys end |
.province(cty) ⇒ Object
27 28 29 |
# File 'lib/ke_counties.rb', line 27 def province(cty) counties.dig(cty, :province) end |