Class: Me2API::Metoo
Constant Summary
Constants inherited from Model
Me2API::Model::FROM_OR_TO_REGEX
Instance Method Summary collapse
-
#initialize(post_id, hash) ⇒ Metoo
constructor
A new instance of Metoo.
- #pub_date ⇒ Object
Methods inherited from Model
#[]=, #id, #iso8601_time, #method_missing, #type, #underscore, wrap
Constructor Details
#initialize(post_id, hash) ⇒ Metoo
Returns a new instance of Metoo.
5 6 7 8 9 |
# File 'lib/me2api/model/metoo.rb', line 5 def initialize(post_id, hash) super(hash) self[:post_id] = post_id 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
11 12 13 14 15 16 |
# File 'lib/me2api/model/metoo.rb', line 11 def pub_date unless self[:pub_date].is_a?(Time) self[:pub_date] = Time.parse(self[:pub_date]) end self[:pub_date] end |