Class: RMeetup::Type::Comment
- Inherits:
-
Object
- Object
- RMeetup::Type::Comment
- Defined in:
- lib/rmeetup/type/comment.rb
Overview
Edited by Jason Berlinsky on 1/20/11 to allow for arbitrary data access See www.meetup.com/meetup_api/docs/ew/comment/ for available fields
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
Instance Method Summary collapse
- #created ⇒ Object
-
#initialize(comment = {}) ⇒ Comment
constructor
A new instance of Comment.
- #lat ⇒ Object
- #lon ⇒ Object
- #method_missing(id, *args) ⇒ Object
-
#rating ⇒ Object
Special accessors that need typecasting or other parsing.
Constructor Details
#initialize(comment = {}) ⇒ Comment
Returns a new instance of Comment.
18 19 20 |
# File 'lib/rmeetup/type/comment.rb', line 18 def initialize(comment = {}) self.comment = comment 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/comment.rb', line 22 def method_missing(id, *args) return self.comment[id.id2name] end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
16 17 18 |
# File 'lib/rmeetup/type/comment.rb', line 16 def comment @comment end |
Instance Method Details
#created ⇒ Object
31 32 33 |
# File 'lib/rmeetup/type/comment.rb', line 31 def created return DateTime.parse(self.comment['created']) end |
#lat ⇒ Object
34 35 36 |
# File 'lib/rmeetup/type/comment.rb', line 34 def lat return self.comment['lat'].to_f end |
#lon ⇒ Object
37 38 39 |
# File 'lib/rmeetup/type/comment.rb', line 37 def lon return self.comment['lon'].to_f end |
#rating ⇒ Object
Special accessors that need typecasting or other parsing
28 29 30 |
# File 'lib/rmeetup/type/comment.rb', line 28 def return self.comment['rating'].to_i end |