class Yelp::Fusion::Endpoint::Phone

Class to search businesses by phone

Constants

PATH

Public Class Methods

new(client) click to toggle source
# File lib/yelp/fusion/endpoint/phone.rb, line 35
def initialize(client)
  @client = client
end

Public Instance Methods

Private Instance Methods

phone_request(phone) click to toggle source

Make a request to the business endpoint of the API The endpoint requires a format of /v3/business_search_phone so the primary request parameter is concatenated. After getting the response back it's checked to see if there are any API errors and raises the relevant one if there is.

@param phone [String] the phone number @return [Faraday::Response] the raw response back from the connection

# File lib/yelp/fusion/endpoint/phone.rb, line 66
def phone_request(phone)
  result = @client.connection.get(PATH, phone)
  Error.check_for_error(result)
  result
end