Module: Foursquared::Pages
- Included in:
- Client
- Defined in:
- lib/foursquared/pages.rb
Overview
Pages module
Instance Method Summary collapse
-
#like_page(page_id, options = {}) ⇒ Foursquared::Response::User
Like or unlike a page.
-
#page(page_id) ⇒ FOursquared::Response::User
Return the page with the given ID.
-
#page_search(options = {}) ⇒ Object
Search Pages.
-
#page_venues(page_id, options = {}) ⇒ Hash
Returns the page’s venues.
Instance Method Details
#like_page(page_id, options = {}) ⇒ Foursquared::Response::User
Like or unlike a page
43 44 45 46 |
# File 'lib/foursquared/pages.rb', line 43 def like_page page_id, ={} response = post("/pages/#{page_id}/like",)["response"] @page = Foursquared::Response::User.new(self, response["user"]) end |
#page(page_id) ⇒ FOursquared::Response::User
Return the page with the given ID
7 8 9 10 |
# File 'lib/foursquared/pages.rb', line 7 def page page_id response = get("/pages/#{page_id}")["response"] @page = Foursquared::Response::User.new(self, response["user"]) end |
#page_search(options = {}) ⇒ Object
Search Pages
17 18 19 20 |
# File 'lib/foursquared/pages.rb', line 17 def page_search ={} response = get("/pages/search",)["response"] @pages = response.collect{|result| Foursquared::Response::User.new(self, result)} end |
#page_venues(page_id, options = {}) ⇒ Hash
Returns the page’s venues.
32 33 34 35 36 |
# File 'lib/foursquared/pages.rb', line 32 def page_venues page_id, ={} @venues = get("/pages/#{page_id}/venues", )["response"]["venues"] @venues["items"].map!{|item| Foursquared::Response::Venue.new(self, item)} @venues end |