Module: FoursquareNext::Pages
- Included in:
- Client
- Defined in:
- lib/foursquare_next/pages.rb
Instance Method Summary collapse
-
#managed_pages(options = {}) ⇒ Object
Returns a list of managed pages.
-
#page(user_id, options = {}) ⇒ Object
Get information about a page.
-
#page_venues(page_id, options = {}) ⇒ Object
Get all venues for a given page.
-
#search_pages(options = {}) ⇒ Object
Search for pages.
Instance Method Details
#managed_pages(options = {}) ⇒ Object
Returns a list of managed pages.
54 55 56 57 58 59 |
# File 'lib/foursquare_next/pages.rb', line 54 def managed_pages( = {}) response = connection.get do |req| req.url "pages/managing", end return_error_or_body(response, response.body.response.managing) end |
#page(user_id, options = {}) ⇒ Object
Get information about a page.
/!\ A page is considered by Foursquare as a user.
9 10 11 12 13 14 |
# File 'lib/foursquare_next/pages.rb', line 9 def page(user_id, = {}) response = connection.get do |req| req.url "pages/#{user_id}", end return_error_or_body(response, response.body.response.user) end |
#page_venues(page_id, options = {}) ⇒ Object
Get all venues for a given page.
41 42 43 44 45 46 47 48 |
# File 'lib/foursquare_next/pages.rb', line 41 def page_venues(page_id, = {}) response = connection.get do |req| req.url "pages/#{page_id}/venues", end venues = return_error_or_body(response, response.body.response.venues) venues = foursquare_next.filter(venues, [:query]) if .has_key? :query venues end |
#search_pages(options = {}) ⇒ Object
Search for pages.
23 24 25 26 27 28 |
# File 'lib/foursquare_next/pages.rb', line 23 def search_pages( = {}) response = connection.get do |req| req.url "pages/search", end return_error_or_body(response, response.body.response) end |