Class: RMeetup::Type::Topic

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#topicObject

Returns the value of attribute topic.



15
16
17
# File 'lib/rmeetup/type/topic.rb', line 15

def topic
  @topic
end

Instance Method Details

#idObject

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

#membersObject



30
31
32
# File 'lib/rmeetup/type/topic.rb', line 30

def members
  return self.topic['members'].to_i
end

#updatedObject



33
34
35
# File 'lib/rmeetup/type/topic.rb', line 33

def updated
  return DateTime.parse(self.topic['updated'])
end