Class: Locality::Postnummerservice::State
- Inherits:
-
Object
- Object
- Locality::Postnummerservice::State
show all
- Includes:
- Collection
- Defined in:
- lib/locality/postnummerservice/state.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Collection
#aregion_codes, #city_names, #initialize, #province_codes, #province_names, #state_codes, #state_names, #zip_codes
Class Method Details
.codes ⇒ Object
10
11
12
13
|
# File 'lib/locality/postnummerservice/state.rb', line 10
def self.codes
array = backend.map { |code, entries| [code, entries.first.state_name] }.sort
Hash[*array.flatten]
end
|
Instance Method Details
#code ⇒ Object
15
16
17
|
# File 'lib/locality/postnummerservice/state.rb', line 15
def code
raw_code.to_i
end
|
#name ⇒ Object
19
20
21
|
# File 'lib/locality/postnummerservice/state.rb', line 19
def name
state_names.first
end
|