Class: Yelp::V2::Search::Request::Base

Inherits:
Request show all
Defined in:
lib/yelpster/v2/search/request/base.rb

Direct Known Subclasses

BoundingBox, GeoPoint, Location

Instance Attribute Summary collapse

Attributes inherited from Request

#consumer_key, #consumer_secret, #response_format, #token, #token_secret

Instance Method Summary collapse

Methods inherited from Request

#initialize, #pull_results

Methods inherited from Record

#initialize

Constructor Details

This class inherits a constructor from Yelp::V2::Request

Instance Attribute Details

#category_filterObject (readonly)

string specifying which business category to search in see www.yelp.com/developers/documentation/category_list for list of categories


30
31
32
# File 'lib/yelpster/v2/search/request/base.rb', line 30

def category_filter
  @category_filter
end

#ccObject (readonly)

————————— Locale Params ——————— string representing default country to use while parsing location field


41
42
43
# File 'lib/yelpster/v2/search/request/base.rb', line 41

def cc
  @cc
end

#deals_filterObject (readonly)

boolean representing if business has a deal available


36
37
38
# File 'lib/yelpster/v2/search/request/base.rb', line 36

def deals_filter
  @deals_filter
end

#langObject (readonly)

string representing which language of reviews to return


44
45
46
# File 'lib/yelpster/v2/search/request/base.rb', line 44

def lang
  @lang
end

#limitObject (readonly)

integer representing number of business results to return


14
15
16
# File 'lib/yelpster/v2/search/request/base.rb', line 14

def limit
  @limit
end

#offsetObject (readonly)

integer representing number of results to skip (for pagination)


17
18
19
# File 'lib/yelpster/v2/search/request/base.rb', line 17

def offset
  @offset
end

#radius_filterObject (readonly)

integer specifying the search radius in meters


33
34
35
# File 'lib/yelpster/v2/search/request/base.rb', line 33

def radius_filter
  @radius_filter
end

#sortObject (readonly)

integer for specifying how to sort results Sort Mode:

0 = Best matched (default)
1 = Distance
2 = Highest rated

see www.yelp.com/developers/documentation/v2/search_api for more info


25
26
27
# File 'lib/yelpster/v2/search/request/base.rb', line 25

def sort
  @sort
end

#termObject (readonly)

————————General Search Params —————– string representing the name of business or search term being requested.


11
12
13
# File 'lib/yelpster/v2/search/request/base.rb', line 11

def term
  @term
end

Instance Method Details

#base_urlObject



47
48
49
# File 'lib/yelpster/v2/search/request/base.rb', line 47

def base_url
  'http://api.yelp.com/v2/search'
end

#to_yelp_paramsObject


51
52
53
54
55
56
57
58
59
60
61
# File 'lib/yelpster/v2/search/request/base.rb', line 51

def to_yelp_params
  super.merge(:term 	=> term,
              :limit 	=> limit,
              :offset => offset,
              :sort 	=> sort,
              :category_filter => category_filter,
              :radius_filter 	=> radius_filter,
              :deals_filter => deals_filter,
              :cc 	=> cc,
              :lang 	=> lang)
end