Module: BWAPI::Client::Location

Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/location.rb

Overview

Location module for locations endpoints

Instance Method Summary collapse

Instance Method Details

#location(location_code) ⇒ Hashie::Mash

Request the information for a given location code

Returns:

  • (Hashie::Mash)

    Information about the location



10
11
12
# File 'lib/bwapi/client/location.rb', line 10

def location(location_code)
  get "location/#{location_code}"
end

#location_autocomplete(opts = {}) ⇒ Hashie::Mash

Autocomplete a location name with candidates

Parameters:

  • opts (String) (defaults to: {})

    prefix that the location starts with

Options Hash (opts):

  • a (Array)

    list of location types to return

  • page (Integer)

    number of results to retrieve

  • pageSize (Integer)

    of the results to retrieve

Returns:

  • (Hashie::Mash)

    The list of matching locations



21
22
23
# File 'lib/bwapi/client/location.rb', line 21

def location_autocomplete(opts = {})
  post 'location/autocomplete', opts
end