Class: Me2API::Metoo

Inherits:
Model
  • Object
show all
Defined in:
lib/me2api/model/metoo.rb

Constant Summary

Constants inherited from Model

Me2API::Model::FROM_OR_TO_REGEX

Instance Method Summary collapse

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_dateObject



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