Class: RMeetup::Type::Photo

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(photo = {}) ⇒ Photo

Returns a new instance of Photo.



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

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

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

Instance Attribute Details

#photoObject

Returns the value of attribute photo.



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

def photo
  @photo
end

Instance Method Details

#createdObject

Special accessors that need typecasting or other parsing



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

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