Class: Whatser::Poi
Instance Attribute Summary collapse
-
#branded_tags ⇒ Object
Returns the value of attribute branded_tags.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#directions ⇒ Object
Returns the value of attribute directions.
-
#district ⇒ Object
Returns the value of attribute district.
-
#foursquare_id ⇒ Object
Returns the value of attribute foursquare_id.
-
#gowalla_id ⇒ Object
Returns the value of attribute gowalla_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lng ⇒ Object
Returns the value of attribute lng.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opening_times ⇒ Object
Returns the value of attribute opening_times.
-
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#pricing ⇒ Object
Returns the value of attribute pricing.
-
#region ⇒ Object
Returns the value of attribute region.
-
#street ⇒ Object
Returns the value of attribute street.
-
#tag_list ⇒ Object
Returns the value of attribute tag_list.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#website ⇒ Object
Returns the value of attribute website.
Attributes inherited from Resource
Class Method Summary collapse
- .create(params = {}) ⇒ Object
- .delete(poi_id) ⇒ Object
- .find(id, opts = {}) ⇒ Object
- .search(opts = {}) ⇒ Object
- .suggested(opts = {}) ⇒ Object
Instance Method Summary collapse
- #activity(opts) ⇒ Object
- #collectors(opts = {}) ⇒ Object
- #comments(opts = {}) ⇒ Object
- #delete ⇒ Object
- #foursquare_connected? ⇒ Boolean
- #gowalla_connected? ⇒ Boolean
- #media(opts = {}) ⇒ Object
- #save ⇒ Object
- #tag(tag_name) ⇒ Object
- #tags(opts = {}) ⇒ Object
- #to_params ⇒ Object
- #visitors(opts = {}) ⇒ Object
Methods inherited from Resource
#api_request, api_request, client, convert_data_to_model, from_hash_to_model, #initialize, set
Constructor Details
This class inherits a constructor from Whatser::Resource
Instance Attribute Details
#branded_tags ⇒ Object
Returns the value of attribute branded_tags.
6 7 8 |
# File 'lib/whatser/resources/poi.rb', line 6 def @branded_tags end |
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def country @country end |
#created_at ⇒ Object
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/whatser/resources/poi.rb', line 6 def created_at @created_at end |
#directions ⇒ Object
Returns the value of attribute directions.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def directions @directions end |
#district ⇒ Object
Returns the value of attribute district.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def district @district end |
#foursquare_id ⇒ Object
Returns the value of attribute foursquare_id.
3 4 5 |
# File 'lib/whatser/resources/poi.rb', line 3 def foursquare_id @foursquare_id end |
#gowalla_id ⇒ Object
Returns the value of attribute gowalla_id.
3 4 5 |
# File 'lib/whatser/resources/poi.rb', line 3 def gowalla_id @gowalla_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/whatser/resources/poi.rb', line 3 def id @id end |
#lat ⇒ Object
Returns the value of attribute lat.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def lat @lat end |
#lng ⇒ Object
Returns the value of attribute lng.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def lng @lng end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def name @name end |
#opening_times ⇒ Object
Returns the value of attribute opening_times.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def opening_times @opening_times end |
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def payment_methods @payment_methods end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def phone_number @phone_number end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def postal_code @postal_code end |
#pricing ⇒ Object
Returns the value of attribute pricing.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def pricing @pricing end |
#region ⇒ Object
Returns the value of attribute region.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def region @region end |
#street ⇒ Object
Returns the value of attribute street.
5 6 7 |
# File 'lib/whatser/resources/poi.rb', line 5 def street @street end |
#tag_list ⇒ Object
Returns the value of attribute tag_list.
6 7 8 |
# File 'lib/whatser/resources/poi.rb', line 6 def tag_list @tag_list end |
#user_id ⇒ Object
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/whatser/resources/poi.rb', line 3 def user_id @user_id end |
#website ⇒ Object
Returns the value of attribute website.
4 5 6 |
# File 'lib/whatser/resources/poi.rb', line 4 def website @website end |
Class Method Details
.create(params = {}) ⇒ Object
21 22 23 |
# File 'lib/whatser/resources/poi.rb', line 21 def create(params={}) api_request :post, "/api/poi", {:body => {'poi' => params} } end |
.delete(poi_id) ⇒ Object
25 26 27 |
# File 'lib/whatser/resources/poi.rb', line 25 def delete(poi_id) api_request :delete, "/api/poi/#{poi_id}" end |
.find(id, opts = {}) ⇒ Object
17 18 19 |
# File 'lib/whatser/resources/poi.rb', line 17 def find(id, opts={}) api_request :get, "/api/poi/#{id}", {:query => opts} end |
.search(opts = {}) ⇒ Object
13 14 15 |
# File 'lib/whatser/resources/poi.rb', line 13 def search(opts={}) api_request :get, "/api/poi", {:query => opts} end |
.suggested(opts = {}) ⇒ Object
9 10 11 |
# File 'lib/whatser/resources/poi.rb', line 9 def suggested(opts={}) api_request :get, "/api/poi/suggested", {:query => opts} end |
Instance Method Details
#activity(opts) ⇒ Object
67 68 69 |
# File 'lib/whatser/resources/poi.rb', line 67 def activity(opts) Whatser::ActivityFeed.set(self.class.client).spot( self.id, opts ) end |
#collectors(opts = {}) ⇒ Object
79 80 81 |
# File 'lib/whatser/resources/poi.rb', line 79 def collectors(opts={}) Whatser::User.set(self.class.client).collectors(id, opts) end |
#comments(opts = {}) ⇒ Object
71 72 73 |
# File 'lib/whatser/resources/poi.rb', line 71 def comments(opts={}) Whatser::Comment.set(self.class.client).poi(id, opts) end |
#delete ⇒ Object
51 52 53 |
# File 'lib/whatser/resources/poi.rb', line 51 def delete Whatser::Poi.delete(id) end |
#foursquare_connected? ⇒ Boolean
83 84 85 |
# File 'lib/whatser/resources/poi.rb', line 83 def foursquare_connected? !foursquare_id.blank? end |
#gowalla_connected? ⇒ Boolean
87 88 89 |
# File 'lib/whatser/resources/poi.rb', line 87 def gowalla_connected? !gowalla_id.blank? end |
#media(opts = {}) ⇒ Object
63 64 65 |
# File 'lib/whatser/resources/poi.rb', line 63 def media(opts={}) Whatser::Media.list(id, opts) end |
#save ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/whatser/resources/poi.rb', line 43 def save if id.blank? self.class.create(to_params) else api_request :put, "/api/poi/#{id}", {:body => {'poi' => to_params} } end end |
#tag(tag_name) ⇒ Object
55 56 57 |
# File 'lib/whatser/resources/poi.rb', line 55 def tag(tag_name) Whatser::Tag.create(id, tag_name) end |
#tags(opts = {}) ⇒ Object
59 60 61 |
# File 'lib/whatser/resources/poi.rb', line 59 def (opts={}) Whatser::Tag.list(id, opts) end |
#to_params ⇒ Object
91 92 93 94 |
# File 'lib/whatser/resources/poi.rb', line 91 def to_params {:name=>name,:lat=>lat,:lng=>lat,:street=>street,:district=>district, :region=>region,:city=>city,:postal_code=>postal_code,:country=>country} end |