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


8
9
10
# File 'lib/yelp/endpoint/business.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#business(id) ⇒ BurstStruct

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:

  • (BurstStruct)

    the parsed response object from the API


21
22
23
# File 'lib/yelp/endpoint/business.rb', line 21

def business(id)
  BurstStruct::Burst.new(JSON.parse(business_request(id).body))
end