Class: CensusFor::Abbrev

Inherits:
Object
  • Object
show all
Defined in:
lib/census_for.rb

Class Method Summary collapse

Class Method Details

.converter(abbrev) ⇒ Object



144
145
146
147
148
149
150
151
# File 'lib/census_for.rb', line 144

def self.converter(abbrev)
  if STATES.has_value?(abbrev.downcase)
    return abbrev.split.map(&:capitalize).join(' ')
  elsif STATES.has_key?(abbrev.downcase.to_sym)
    return STATES[abbrev.downcase.to_sym].split.map(&:capitalize).join(' ')
  else return nil
  end
end