Class: RMeetup::Type::City
- Inherits:
-
Object
- Object
- RMeetup::Type::City
- Defined in:
- lib/rmeetup/type/city.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
-
#city ⇒ Object
Returns the value of attribute city.
Instance Method Summary collapse
-
#initialize(city = {}) ⇒ City
constructor
A new instance of City.
-
#lat ⇒ Object
Special accessors that need typecasting or other parsing.
- #lon ⇒ Object
- #members ⇒ Object
- #method_missing(id, *args) ⇒ Object
Constructor Details
#initialize(city = {}) ⇒ City
Returns a new instance of City.
18 19 20 |
# File 'lib/rmeetup/type/city.rb', line 18 def initialize(city = {}) self.city = city 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/city.rb', line 22 def method_missing(id, *args) return self.city[id.id2name] end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
16 17 18 |
# File 'lib/rmeetup/type/city.rb', line 16 def city @city end |
Instance Method Details
#lat ⇒ Object
Special accessors that need typecasting or other parsing
28 29 30 |
# File 'lib/rmeetup/type/city.rb', line 28 def lat return self.city['lat'].to_f end |
#lon ⇒ Object
31 32 33 |
# File 'lib/rmeetup/type/city.rb', line 31 def lon return self.city['lon'].to_f end |
#members ⇒ Object
34 35 36 |
# File 'lib/rmeetup/type/city.rb', line 34 def members return self.city['members'].to_i end |