Class: Foursquare::Venue

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

authentication, connect, latitude, location, location=, longitude

Constructor Details

#initialize(attributes = nil) ⇒ Venue

Returns a new instance of Venue.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/foursquare/venue.rb', line 19

def initialize(attributes = nil)
  if attributes
    self.id           = attributes['id']
    self.name         = attributes['name']
    self.address      = attributes['address']
    self.city         = attributes['city']
    self.state        = attributes['state']
    self.zip          = attributes['zip']
    self.cross_street = attributes['crossstreet']
    self.phone        = attributes['phone']
    self.latitude     = attributes['geolat']
    self.longitude    = attributes['geolong']
    self.distance     = attributes['distance']
  end
end

Class Method Details

.attribute_namesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/foursquare/venue.rb', line 3

def self.attribute_names
  [:id,
   :name,
   :address,
   :city,
   :state,
   :zip,
   :cross_street,
   :phone,
   :latitude,
   :longitude,
   :distance]
end

.find(*args) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/foursquare/venue.rb', line 35

def self.find(*args)
  options = extract_options(args)
  case args.first
    when :all   then find_all(options)
    when :first then find_first(options)
  end
end