Class: String

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

Instance Method Summary collapse

Instance Method Details

#to_sym_cityObject



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/place.rb', line 76

def to_sym_city
  I18n.config.available_locales = :en
  begin
    raise "ElTiempoBCN gem can't handle encoding yet. Please contact the author for more details" unless return_string =  I18n.transliterate( self ).tr( " ", "" ).downcase.to_sym
    return return_string
  rescue Encoding::CompatibilityError => e
    raise unless return_string =  I18n.transliterate( self.encode( "UTF-8", "UTF-16LE" ) ).tr( " ", "" ).downcase.to_sym
    puts e
    puts e.backtrace.inspect
  end
end