Class: Yelp::Endpoint::Business

Inherits:
Object
  • Object
show all
Defined in:
lib/yelp/endpoint/business.rb

Constant Summary collapse

PATH =
'/v2/business/'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Business

Returns a new instance of Business.



11
12
13
# File 'lib/yelp/endpoint/business.rb', line 11

def initialize(client)
  @client = client
end

Instance Method Details

#business(id, locale = {}) ⇒ Response::Business

Make a request to the business endpoint on the API

Examples:

Get business

business = client.business('yelp-san-francisco')
business.name # => 'Yelp'
buinesss.url  # => 'http://www.yelp.com/biz/yelp-san-francisco'

Parameters:

  • id (String)

    the business id

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

    a hash of supported locale-related parameters

Returns:



25
26
27
# File 'lib/yelp/endpoint/business.rb', line 25

def business(id, locale = {})
  Response::Business.new(JSON.parse(business_request(id, locale).body))
end