Skip to content

Commit

Permalink
Add creation date to posts
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahzs committed Jan 14, 2018
1 parent 5cfb22e commit d5cba30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/se/api/types/post.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SE
module API
class Post
attr_reader :body, :title, :link, :author, :score, :type, :id, :last_activity_date
attr_reader :body, :title, :link, :author, :score, :type, :id, :last_activity_date, :created_at, :updated_at
attr_reader :json

def initialize(item_json)
Expand All @@ -12,7 +12,9 @@ def initialize(item_json)
@score = item_json["score"].to_i
@type = item_json["post_type"]
@id = item_json["id"].to_i
@last_activity_date = item_json["last_activity_date"]
@updated_at = item_json["last_activity_date"]
@created_at = item_json["creation_date"]
@last_activity_date = @updated_at
# @author = User.new(item_json["author"])
end
end
Expand Down

0 comments on commit d5cba30

Please sign in to comment.