geonames.rb
# The ISO country code of any given point.
#
# Parameters: lat, lng, type, lang, and radius (buffer in km for closest
# country in coastal areas)
#
# With the parameter type=xml this service returns an xml document with iso
# country code and country name. The optional parameter lang can be used to
# specify the language the country name should be in.
# JSON output is produced with type=JSON, which is the default for this
# library and will be parsed automatically.
#
# Example:
#
#   api.country_code(lat: 47.03, lng: 10.2)
The ISO country code of any given point.
Parameters: lat, lng, type, lang, and radius (buffer in km for closest
country in coastal areas)

With the parameter type=xml this service returns an xml document with iso
country code and country name. The optional parameter lang can be used to
specify the language the country name should be in.
JSON output is produced with type=JSON, which is the default for this
library and will be parsed automatically.




The ISO country code of any given point . Parameters : lat lng type lang and radius ( buffer in km for closest country in coastal areas ) With the parameter type = xml this service returns an xml document with iso country code and country name . The optional parameter lang can be used to specify the language the country name should be in . JSON output is produced with type = JSON which is the default for this library and will be parsed automatically .
def country_code(parameters = {})
    if parameters[:type].to_s =~ /^xml$/i
      query(:countryCode, parameters){|content| return content }
    else
      query(:countryCode, {type: 'JSON'}.merge(parameters))
    end
  end
def country_code ( parameters = { } ) if parameters [ :type ] . to_s =~ / ^xml$ /i query ( :countryCode , parameters ) { | content | return content } else query ( :countryCode , { type : 'JSON' } . merge ( parameters ) ) end end
The ISO country code of any given point.
The ISO country code of any given point .
parameters
<not_specific>