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
26 27 28 |
# File 'lib/foursquare/venue_proxy.rb', line 26 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
30 31 32 |
# File 'lib/foursquare/venue_proxy.rb', line 30 def nearby(={}) search_group("nearby", ) end |
#search(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# 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 venues end end |
#trending(options = {}) ⇒ Object
22 23 24 |
# File 'lib/foursquare/venue_proxy.rb', line 22 def trending(={}) search_group("trending", ) end |