Class: RMeetup::Type::Event
- Inherits:
-
Object
- Object
- RMeetup::Type::Event
show all
- Defined in:
- lib/rmeetup/type/event.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(event = {}) ⇒ Event
Returns a new instance of Event.
18
19
20
|
# File 'lib/rmeetup/type/event.rb', line 18
def initialize(event = {})
self.event = event
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/event.rb', line 22
def method_missing(id, *args)
return self.event[id.id2name]
end
|
Instance Attribute Details
#event ⇒ Object
Returns the value of attribute event.
16
17
18
|
# File 'lib/rmeetup/type/event.rb', line 16
def event
@event
end
|
Instance Method Details
#id ⇒ Object
Special accessors that need typecasting or other parsing
27
28
29
|
# File 'lib/rmeetup/type/event.rb', line 27
def id
self.event['id'].to_i
end
|
#lat ⇒ Object
30
31
32
|
# File 'lib/rmeetup/type/event.rb', line 30
def lat
self.event['lat'].to_f
end
|
#lon ⇒ Object
33
34
35
|
# File 'lib/rmeetup/type/event.rb', line 33
def lon
self.event['lon'].to_f
end
|
#rsvpcount ⇒ Object
36
37
38
|
# File 'lib/rmeetup/type/event.rb', line 36
def rsvpcount
self.event['rsvpcount'].to_i
end
|
#time ⇒ Object
42
43
44
|
# File 'lib/rmeetup/type/event.rb', line 42
def time
DateTime.parse(self.event['time'])
end
|
#updated ⇒ Object
39
40
41
|
# File 'lib/rmeetup/type/event.rb', line 39
def updated
DateTime.parse(self.event['updated'])
end
|