Skip to content

Commit

Permalink
Hashified all item_json
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahzs committed Jan 20, 2018
1 parent 3c21018 commit 335df04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/se/api/types/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Comment
attr_reader :json

def initialize(item_json)
@json = item_json
@json = Hash(item_json)
@body = @json["body"]
@body_markdown = @json["body_markdown"]
@link = @json["link"]
Expand Down
2 changes: 1 addition & 1 deletion lib/se/api/types/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Post
attr_reader :json

def initialize(item_json)
@json = item_json
@json = Hash(item_json)
@body = @json["body"]
@title = @json["title"]
@link = @json["link"]
Expand Down
2 changes: 1 addition & 1 deletion lib/se/api/types/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class User
attr_reader :json, :accept_rate, :badge_counts, :name, :link, :image, :reputation, :id, :type

def initialize(item_json)
@json = item_json
@json = Hash(item_json)
@accept_rate = @json["accept_rate"]
@badge_counts = @json["badge_counts"]
@name = @json["display_name"]
Expand Down

0 comments on commit 335df04

Please sign in to comment.