Class: RMeetup::Type::Venue

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

Overview

Edited by Jason Berlinsky on 1/20/11 to allow for arbitrary data access See www.meetup.com/meetup_api/docs/cities/ for available fields

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(venue = {}) ⇒ Venue

Returns a new instance of Venue.



18
19
20
# File 'lib/rmeetup/type/venue.rb', line 18

def initialize(venue = {})
  self.venue = venue
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object



22
23
24
# File 'lib/rmeetup/type/venue.rb', line 22

def method_missing(id, *args)
  return self.venue[id.id2name]
end

Instance Attribute Details

#venueObject

Returns the value of attribute venue.



16
17
18
# File 'lib/rmeetup/type/venue.rb', line 16

def venue
  @venue
end

Instance Method Details

#address_1Object



37
38
39
# File 'lib/rmeetup/type/venue.rb', line 37

def address_1
  return self.venue['address_1'].to_s
end

#cityObject



40
41
42
# File 'lib/rmeetup/type/venue.rb', line 40

def city
  return self.venue['city'].to_s
end

#countryObject



43
44
45
# File 'lib/rmeetup/type/venue.rb', line 43

def country
  return self.venue['country'].to_s
end

#distanceObject



46
47
48
# File 'lib/rmeetup/type/venue.rb', line 46

def distance
  return self.venue['distance'].to_i
end

#idObject

Special accessors that need typecasting or other parsing



28
29
30
# File 'lib/rmeetup/type/venue.rb', line 28

def id
  return self.venue['id'].to_i
end

#latObject



55
56
57
# File 'lib/rmeetup/type/venue.rb', line 55

def lat
  return self.venue['lat'].to_f
end

#lonObject



58
59
60
# File 'lib/rmeetup/type/venue.rb', line 58

def lon
  return self.venue['lon'].to_f
end

#ratingObject



52
53
54
# File 'lib/rmeetup/type/venue.rb', line 52

def rating
  return self.venue['rating'].to_s
end

#rating_countObject



49
50
51
# File 'lib/rmeetup/type/venue.rb', line 49

def rating_count
  return self.venue['rating_count'].to_i
end

#stateObject



34
35
36
# File 'lib/rmeetup/type/venue.rb', line 34

def state
  return self.venue['state'].to_s
end

#zipObject



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

def zip
  return self.venue['zip'].to_s
end