Module: NYCGeoClient::Client::Place

Included in:
NYCGeoClient::Client
Defined in:
lib/nyc_geo_client/client/place.rb

Overview

Defines methods related to branches

Instance Method Summary collapse

Instance Method Details

#place(name:, borough: nil, zip: nil) ⇒ Hashie::Mash

Returns address information using a well-known place name as input.

Examples:

address information using a well-known place name

NYCGeoClient.place('empire state building')

Parameters:

  • name (String)

    A well-known New York City place name

  • borough (String) (defaults to: nil)

    The borough in which the place is located

Returns:

  • (Hashie::Mash)


14
15
16
17
18
19
20
21
# File 'lib/nyc_geo_client/client/place.rb', line 14

def place(name:, borough: nil, zip: nil)
  options = {
    name:    name,
    borough: borough,
    zip: zip
  }.reject { |k, v| v.nil? }
  get(place_path, options)
end