Class: Foursquare::Venue

Inherits:
Object
  • Object
show all
Defined in:
lib/foursquare/venue.rb

Instance Method Summary collapse

Constructor Details

#initialize(foursquare, json) ⇒ Venue

Returns a new instance of Venue.



3
4
5
# File 'lib/foursquare/venue.rb', line 3

def initialize(foursquare, json)
  @foursquare, @json = foursquare, json
end

Instance Method Details

#categoriesObject



23
24
25
# File 'lib/foursquare/venue.rb', line 23

def categories
  @json["categories"]
end

#checkins_countObject



31
32
33
# File 'lib/foursquare/venue.rb', line 31

def checkins_count
  @json["stats"]["checkinsCount"]
end

#contactObject



15
16
17
# File 'lib/foursquare/venue.rb', line 15

def contact
  @json["contact"]
end

#idObject



7
8
9
# File 'lib/foursquare/venue.rb', line 7

def id
  @json["id"]
end

#locationObject



19
20
21
# File 'lib/foursquare/venue.rb', line 19

def location
  @json["location"]
end

#nameObject



11
12
13
# File 'lib/foursquare/venue.rb', line 11

def name
  @json["name"]
end

#photos(options = {:group => "checkin"}) ⇒ Object



43
44
45
46
47
# File 'lib/foursquare/venue.rb', line 43

def photos(options={:group => "checkin"})
  @foursquare.get("venues/#{id}/photos", options)["photos"]["items"].map do |item|
    Foursquare::Photo.new(@foursquare, item)
  end
end

#todos_countObject



39
40
41
# File 'lib/foursquare/venue.rb', line 39

def todos_count
  @json["todos"]["count"]
end

#users_countObject



35
36
37
# File 'lib/foursquare/venue.rb', line 35

def users_count
  @json["stats"]["usersCount"]
end

#verified?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/foursquare/venue.rb', line 27

def verified?
  @json["verified"]
end