Module: BellPepper

Extended by:
Configuration
Defined in:
lib/bell_pepper.rb,
lib/bell_pepper/error.rb,
lib/bell_pepper/request.rb,
lib/bell_pepper/version.rb

Defined Under Namespace

Classes: BadGateway, BadRequest, Error, GatewayTimeout, InternalServerError, NotFound, Request, ServiceUnavailable

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Methods included from Configuration

configuration, define_setting

Class Method Details

.bestgeoref(id: nil, city: nil, continent: nil, county: nil, country: nil, country_code: nil, give_me: "BEST_GEOREF", island: nil, locality: nil, municipality: nil, state_province: nil, verbose: false) ⇒ Hash

Get a georeference

Parameters:

  • id (String) (defaults to: nil)

    an optional identifier that will be returned with the result

  • city (String) (defaults to: nil)

    The city

  • continent (String) (defaults to: nil)

    The name of the continent in which the Location occurs

  • county (String) (defaults to: nil)

    The full, unabbreviated name of the next smaller administrative region than stateProvince (county, shire, department, etc.) in which the Location occurs

  • country (String) (defaults to: nil)

    The name of the country or major administrative unit in which the Location occurs

  • country_code (String) (defaults to: nil)

    The ISO 3166-1-alpha-2 code for the country in which the Location occurs

  • give_me (String) (defaults to: "BEST_GEOREF")

    The type of georeference match (BEST_GEOREF)

  • locality (String) (defaults to: nil)

    The specific description of the place

  • state_province (String) (defaults to: nil)

    The name of the next smaller administrative region than country (state, province, canton, department, region, etc.) in which the Location occurs

Returns:

  • (Hash)

    A georeference result hash



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/bell_pepper.rb', line 30

def self.bestgeoref(id: nil, city: nil, continent: nil, county: nil, country: nil, country_code: nil, 
  give_me: "BEST_GEOREF", island: nil, locality: nil, municipality: nil, state_province: nil, verbose: false)
  endpoint = "bestgeoref"
  Request.new(
    endpoint: endpoint, 
    id: id, 
    city: city, 
    continent: continent, 
    county: county, 
    country: country, 
    country_code: country_code, 
    give_me: give_me, 
    locality: locality, 
    state_province: state_province,
    verbose: verbose).perform
end