Class: Mosaic::Foursquare::Venue
- Defined in:
- lib/mosaic/foursquare/venue.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#canonical_url ⇒ Object
Returns the value of attribute canonical_url.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#location ⇒ Object
Returns the value of attribute location.
-
#mayor ⇒ Object
Returns the value of attribute mayor.
-
#name ⇒ Object
Returns the value of attribute name.
-
#short_url ⇒ Object
Returns the value of attribute short_url.
-
#stats ⇒ Object
Returns the value of attribute stats.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#updates ⇒ Object
Returns the value of attribute updates.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #herenow(options = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Venue
constructor
A new instance of Venue.
- #photos(options = {}) ⇒ Object
Methods inherited from Object
query, request_count, request_count=
Methods included from Utils::Helpers
Constructor Details
#initialize(attributes = {}) ⇒ Venue
Returns a new instance of Venue.
26 27 28 29 30 31 32 33 34 |
# File 'lib/mosaic/foursquare/venue.rb', line 26 def initialize(attributes = {}) super self.location &&= Mosaic::Foursquare::Venue::Location.new(self.location) self.updates = Mosaic::Foursquare::Update.from_venue(attributes) self.mayor &&= (self.mayor['user'] ? Mosaic::Foursquare::User.new(self.mayor['user']) : nil) self.stats &&= Mosaic::Foursquare::Venue::Stats.new(self.stats) self.stats.photos_count = attributes["photos"]["count"] self.stats.updates_count = attributes["pageUpdates"]["count"] end |
Instance Attribute Details
#canonical_url ⇒ Object
Returns the value of attribute canonical_url.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def canonical_url @canonical_url end |
#created_at ⇒ Object
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def id @id end |
#location ⇒ Object
Returns the value of attribute location.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def location @location end |
#mayor ⇒ Object
Returns the value of attribute mayor.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def mayor @mayor end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def name @name end |
#short_url ⇒ Object
Returns the value of attribute short_url.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def short_url @short_url end |
#stats ⇒ Object
Returns the value of attribute stats.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def stats @stats end |
#tags ⇒ Object
Returns the value of attribute tags.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def @tags end |
#updates ⇒ Object
Returns the value of attribute updates.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def updates @updates end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/mosaic/foursquare/venue.rb', line 6 def url @url end |
Class Method Details
.find(id, options = {}) ⇒ Object
9 10 11 12 |
# File 'lib/mosaic/foursquare/venue.rb', line 9 def find(id, = {}) response = query("/venues/#{id}", ) self.new response['response']['venue'] end |
Instance Method Details
#herenow(options = {}) ⇒ Object
36 37 38 39 |
# File 'lib/mosaic/foursquare/venue.rb', line 36 def herenow( = {}) response = self.class.query("/venues/#{id}/herenow", ) response['response']['hereNow']['items'].collect { |item| Mosaic::Foursquare::Checkin.new(item) } end |
#photos(options = {}) ⇒ Object
41 42 43 44 |
# File 'lib/mosaic/foursquare/venue.rb', line 41 def photos( = {}) response = self.class.query("/venues/#{id}/photos", ) response['response']['photos']['items'].collect { |item| Mosaic::Foursquare::Photo.new(item) } end |