Class: Locality::Postnummerservice::Province

Inherits:
Object
  • Object
show all
Includes:
Collection
Defined in:
lib/locality/postnummerservice/province.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

.codesObject



10
11
12
# File 'lib/locality/postnummerservice/province.rb', line 10

def self.codes
  Hash[backend.map { |code, entries| [code, entries.first.province_name] }]
end

Instance Method Details

#codeObject



14
15
16
# File 'lib/locality/postnummerservice/province.rb', line 14

def code
  raw_code.to_s.strip
end

#nameObject



18
19
20
# File 'lib/locality/postnummerservice/province.rb', line 18

def name
  province_names.first
end