Module: NYCGeoClient::Client::Intersection

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

Overview

Defines methods related to branches

Instance Method Summary collapse

Instance Method Details

#intersection(cross_street_one, cross_street_two, borough, extra = {}) ⇒ Hashie::Mash

Returns information about a point defined by two cross streets.

Examples:

information about a segment defined by an on street between two cross-streets

NYCGeoClient.blockface('34 st', 'fifht ave', 'manhattan')

Parameters:

  • cross_street_one (String)

    The first cross street

  • cross_street_two (String)

    The second cross street

  • borough (String)

    The borough in which the on_street is located

  • extra (Hash) (defaults to: {})

    optional params:

    • boroughCrossStreetTwo: The borough in which the cross_street_two is located if it differs from the borough parameter

    • compassDirection: Used when requesting information about only one side of the street (north, south, west, east, n, s, w, e)

Returns:

  • (Hashie::Mash)


18
19
20
21
22
23
24
25
# File 'lib/nyc_geo_client/client/intersection.rb', line 18

def intersection(cross_street_one, cross_street_two, borough, extra = {})
  options = {
    crossStreetOne: cross_street_one,
    crossStreetTwo: cross_street_two,
    borough: borough
  }.merge(extra)
  get(intersection_path, options)
end