Class: CensusFor::Abbrev

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

Class Method Summary collapse

Class Method Details

.converter(abbrev) ⇒ Object



129
130
131
132
133
134
135
136
# File 'lib/census_for.rb', line 129

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