Class: Phoebe::Resources::Ref::Region::Adjacent

Inherits:
Object
  • Object
show all
Defined in:
lib/phoebe/resources/ref/region/adjacent.rb

Overview

With the ref/geo end-point you can find a country’s or region’s neighbours.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Adjacent

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Adjacent.

Parameters:



34
35
36
# File 'lib/phoebe/resources/ref/region/adjacent.rb', line 34

def initialize(client:)
  @client = client
end

Instance Method Details

#list(region_code, request_options: {}) ⇒ Array<Phoebe::Models::Ref::Region::AdjacentListResponseItem>

Get the list of countries or regions that share a border with this one. #### Notes Only subnational2 codes in the United States, New Zealand, or Mexico are currently supported

Parameters:

  • region_code (String)

    The country, subnational1 or subnational2 code.

  • request_options (Phoebe::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/phoebe/resources/ref/region/adjacent.rb', line 22

def list(region_code, params = {})
  @client.request(
    method: :get,
    path: ["ref/adjacent/%1$s", region_code],
    model: Phoebe::Internal::Type::ArrayOf[Phoebe::Models::Ref::Region::AdjacentListResponseItem],
    options: params[:request_options]
  )
end