Class: RMeetup::Type::Topic
- Inherits:
-
Object
- Object
- RMeetup::Type::Topic
- Defined in:
- lib/rmeetup/type/topic.rb
Overview
Edited by Jason Berlinsky on 1/20/11 to allow for arbitrary data access See www.meetup.com/meetup_api/docs/topics/ for available fields
Instance Attribute Summary collapse
-
#topic ⇒ Object
Returns the value of attribute topic.
Instance Method Summary collapse
-
#id ⇒ Object
Special accessors that need typecasting or other parsing.
-
#initialize(topic = {}) ⇒ Topic
constructor
A new instance of Topic.
- #members ⇒ Object
- #method_missing(id, *args) ⇒ Object
- #updated ⇒ Object
Constructor Details
#initialize(topic = {}) ⇒ Topic
Returns a new instance of Topic.
17 18 19 |
# File 'lib/rmeetup/type/topic.rb', line 17 def initialize(topic = {}) self.topic = topic end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(id, *args) ⇒ Object
21 22 23 |
# File 'lib/rmeetup/type/topic.rb', line 21 def method_missing(id, *args) return self.topic[id.id2name] end |
Instance Attribute Details
#topic ⇒ Object
Returns the value of attribute topic.
15 16 17 |
# File 'lib/rmeetup/type/topic.rb', line 15 def topic @topic end |
Instance Method Details
#id ⇒ Object
Special accessors that need typecasting or other parsing
27 28 29 |
# File 'lib/rmeetup/type/topic.rb', line 27 def id return self.topic['id'].to_i end |
#members ⇒ Object
30 31 32 |
# File 'lib/rmeetup/type/topic.rb', line 30 def members return self.topic['members'].to_i end |
#updated ⇒ Object
33 34 35 |
# File 'lib/rmeetup/type/topic.rb', line 33 def updated return DateTime.parse(self.topic['updated']) end |