diff --git a/lib/se/api/types/comment.rb b/lib/se/api/types/comment.rb index 51cfa62..a3fc7e7 100644 --- a/lib/se/api/types/comment.rb +++ b/lib/se/api/types/comment.rb @@ -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"] diff --git a/lib/se/api/types/post.rb b/lib/se/api/types/post.rb index 31e99b0..bcce02e 100644 --- a/lib/se/api/types/post.rb +++ b/lib/se/api/types/post.rb @@ -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"] diff --git a/lib/se/api/types/user.rb b/lib/se/api/types/user.rb index ff8df9a..6c913c3 100644 --- a/lib/se/api/types/user.rb +++ b/lib/se/api/types/user.rb @@ -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"]