Class: Me2API::Comment
Constant Summary
Constants inherited from Model
Instance Method Summary collapse
-
#initialize(post_id, hash, options = {}) ⇒ Comment
constructor
A new instance of Comment.
- #pub_date ⇒ Object
Methods inherited from Model
#[]=, #id, #iso8601_time, #method_missing, #type, #underscore, wrap
Constructor Details
#initialize(post_id, hash, options = {}) ⇒ Comment
Returns a new instance of Comment.
5 6 7 8 9 10 |
# File 'lib/me2api/model/comment.rb', line 5 def initialize(post_id, hash, = {}) super(hash) self[:post_id] = post_id self[:post_permalink] = [:post_permalink] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Me2API::Model
Instance Method Details
#pub_date ⇒ Object
12 13 14 15 16 17 |
# File 'lib/me2api/model/comment.rb', line 12 def pub_date unless self[:pub_date].is_a?(Time) self[:pub_date] = Time.parse(self[:pub_date]) end self[:pub_date] end |