Class: RMeetup::Type::Group

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group = {}) ⇒ Group

Returns a new instance of Group.



17
18
19
# File 'lib/rmeetup/type/group.rb', line 17

def initialize(group = {})
  self.group = group
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/group.rb', line 21

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

Instance Attribute Details

#groupObject

Returns the value of attribute group.



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

def group
  @group
end

Instance Method Details

#createdObject



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

def created
  return DateTime.parse(self.group['created'])
end

#daysleftObject



42
43
44
# File 'lib/rmeetup/type/group.rb', line 42

def daysleft
  return self.group['daysleft'].to_i
end

#idObject

Special accessors that need typecasting or other parsing



27
28
29
# File 'lib/rmeetup/type/group.rb', line 27

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

#latObject



36
37
38
# File 'lib/rmeetup/type/group.rb', line 36

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

#lonObject



39
40
41
# File 'lib/rmeetup/type/group.rb', line 39

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

#updatedObject



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

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