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.



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

def initialize(client)
  @client = client
end

Instance Method Details

#business(id) ⇒ 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

Returns:



23
24
25
# File 'lib/yelp/endpoint/business.rb', line 23

def business(id)
  Response::Business.new(JSON.parse(business_request(id).body))
end