Class: Foursquare::VenueProxy
- Inherits:
-
Object
- Object
- Foursquare::VenueProxy
- Defined in:
- lib/foursquare/venue_proxy.rb
Instance Method Summary collapse
- #favorites(options = {}) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(foursquare) ⇒ VenueProxy
constructor
A new instance of VenueProxy.
- #nearby(options = {}) ⇒ Object
- #search(options = {}) ⇒ Object
- #trending(options = {}) ⇒ Object
Constructor Details
#initialize(foursquare) ⇒ VenueProxy
Returns a new instance of VenueProxy.
3 4 5 |
# File 'lib/foursquare/venue_proxy.rb', line 3 def initialize(foursquare) @foursquare = foursquare end |
Instance Method Details
#favorites(options = {}) ⇒ Object
25 26 27 |
# File 'lib/foursquare/venue_proxy.rb', line 25 def favorites(={}) search_group("favorites", ) end |
#find(id) ⇒ Object
7 8 9 |
# File 'lib/foursquare/venue_proxy.rb', line 7 def find(id) Foursquare::Venue.new(@foursquare, @foursquare.get("venues/#{id}")["venue"]) end |
#nearby(options = {}) ⇒ Object
29 30 31 |
# File 'lib/foursquare/venue_proxy.rb', line 29 def nearby(={}) search_group("nearby", ) end |
#search(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/foursquare/venue_proxy.rb', line 11 def search(={}) raise ArgumentError, "You must include :ll" unless [:ll] response = @foursquare.get('venues/search', )["groups"].inject({}) do |venues, group| venues[group["type"]] ||= [] venues[group["type"]] << group["items"].map do |json| Foursquare::Venue.new(@foursquare, json) end end end |
#trending(options = {}) ⇒ Object
21 22 23 |
# File 'lib/foursquare/venue_proxy.rb', line 21 def trending(={}) search_group("trending", ) end |