{"action":"created","comment":{"url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/comments/24897582","id":24897582,"diff_hunk":"@@ -3,15 +3,25 @@ module Entities\n     class BaseEntity\n       include Virtus.model\n \n-      def self.from_collection(entities)\n-        entities.map do |entity|\n-          new(entity)\n-        end\n+      def self.from_collection(entities, content_range)","path":"lib/bitreserve/entities/base_entity.rb","position":8,"original_position":8,"commit_id":"7c58a0ba146688681f43ea541160802bc86e8f0d","original_commit_id":"7c58a0ba146688681f43ea541160802bc86e8f0d","user":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"body":"I'm assuming it is not for now (mostly to pass the tests without having to add pagination everywhere), but maybe it can be, since they are adding pagination to all of the collection endpoints.","created_at":"2015-02-18T12:31:00Z","updated_at":"2015-02-18T12:31:00Z","html_url":"https://github.com/groupbuddies/bitreserve/pull/39#discussion_r24897582","pull_request_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/comments/24897582"},"html":{"href":"https://github.com/groupbuddies/bitreserve/pull/39#discussion_r24897582"},"pull_request":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39","id":29517138,"html_url":"https://github.com/groupbuddies/bitreserve/pull/39","diff_url":"https://github.com/groupbuddies/bitreserve/pull/39.diff","patch_url":"https://github.com/groupbuddies/bitreserve/pull/39.patch","issue_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/39","number":39,"state":"open","locked":false,"title":"Possible implementation of pagination","user":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"body":"This is just a draft.\r\n\r\nIn the future we might add methods like `next`, `previous` and the likes, for\r\nnow this puts that responsibility on the client, but it works.\r\n\r\nWrapping the collection array in a class lays the foundation to build that sort\r\nof functionality, even though right now it's only job is to allow the client to\r\nknow the total size of the collection.\r\n\r\nThis has the added benefit that it is backward compatible.\r\n\r\nFixes #37 \r\n\r\n@naps62  What do you think of this approach?","created_at":"2015-02-18T11:09:31Z","updated_at":"2015-02-18T12:31:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc6a714bc5e815a2c27433523ed0cd580c64a7e8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39/commits","review_comments_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39/comments","review_comment_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/comments/{number}","comments_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/39/comments","statuses_url":"https://api.github.com/repos/groupbuddies/bitreserve/statuses/7c58a0ba146688681f43ea541160802bc86e8f0d","head":{"label":"groupbuddies:pagination","ref":"pagination","sha":"7c58a0ba146688681f43ea541160802bc86e8f0d","user":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"repo":{"id":29684387,"name":"bitreserve","full_name":"groupbuddies/bitreserve","owner":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groupbuddies/bitreserve","description":"A wrapper for the Bitreserve API","fork":false,"url":"https://api.github.com/repos/groupbuddies/bitreserve","forks_url":"https://api.github.com/repos/groupbuddies/bitreserve/forks","keys_url":"https://api.github.com/repos/groupbuddies/bitreserve/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groupbuddies/bitreserve/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groupbuddies/bitreserve/teams","hooks_url":"https://api.github.com/repos/groupbuddies/bitreserve/hooks","issue_events_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/events{/number}","events_url":"https://api.github.com/repos/groupbuddies/bitreserve/events","assignees_url":"https://api.github.com/repos/groupbuddies/bitreserve/assignees{/user}","branches_url":"https://api.github.com/repos/groupbuddies/bitreserve/branches{/branch}","tags_url":"https://api.github.com/repos/groupbuddies/bitreserve/tags","blobs_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/refs{/sha}","trees_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groupbuddies/bitreserve/statuses/{sha}","languages_url":"https://api.github.com/repos/groupbuddies/bitreserve/languages","stargazers_url":"https://api.github.com/repos/groupbuddies/bitreserve/stargazers","contributors_url":"https://api.github.com/repos/groupbuddies/bitreserve/contributors","subscribers_url":"https://api.github.com/repos/groupbuddies/bitreserve/subscribers","subscription_url":"https://api.github.com/repos/groupbuddies/bitreserve/subscription","commits_url":"https://api.github.com/repos/groupbuddies/bitreserve/commits{/sha}","git_commits_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/commits{/sha}","comments_url":"https://api.github.com/repos/groupbuddies/bitreserve/comments{/number}","issue_comment_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/comments/{number}","contents_url":"https://api.github.com/repos/groupbuddies/bitreserve/contents/{+path}","compare_url":"https://api.github.com/repos/groupbuddies/bitreserve/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groupbuddies/bitreserve/merges","archive_url":"https://api.github.com/repos/groupbuddies/bitreserve/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groupbuddies/bitreserve/downloads","issues_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues{/number}","pulls_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls{/number}","milestones_url":"https://api.github.com/repos/groupbuddies/bitreserve/milestones{/number}","notifications_url":"https://api.github.com/repos/groupbuddies/bitreserve/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groupbuddies/bitreserve/labels{/name}","releases_url":"https://api.github.com/repos/groupbuddies/bitreserve/releases{/id}","created_at":"2015-01-22T15:09:41Z","updated_at":"2015-02-09T14:54:44Z","pushed_at":"2015-02-18T11:28:45Z","git_url":"git://github.com/groupbuddies/bitreserve.git","ssh_url":"git@github.com:groupbuddies/bitreserve.git","clone_url":"https://github.com/groupbuddies/bitreserve.git","svn_url":"https://github.com/groupbuddies/bitreserve","homepage":null,"size":901,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":5,"default_branch":"master"}},"base":{"label":"groupbuddies:master","ref":"master","sha":"432f29b7eed2469b8cd036e3455c2caea20b1cdd","user":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"repo":{"id":29684387,"name":"bitreserve","full_name":"groupbuddies/bitreserve","owner":{"login":"groupbuddies","id":1085467,"avatar_url":"https://avatars.githubusercontent.com/u/1085467?v=3","gravatar_id":"","url":"https://api.github.com/users/groupbuddies","html_url":"https://github.com/groupbuddies","followers_url":"https://api.github.com/users/groupbuddies/followers","following_url":"https://api.github.com/users/groupbuddies/following{/other_user}","gists_url":"https://api.github.com/users/groupbuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/groupbuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groupbuddies/subscriptions","organizations_url":"https://api.github.com/users/groupbuddies/orgs","repos_url":"https://api.github.com/users/groupbuddies/repos","events_url":"https://api.github.com/users/groupbuddies/events{/privacy}","received_events_url":"https://api.github.com/users/groupbuddies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groupbuddies/bitreserve","description":"A wrapper for the Bitreserve API","fork":false,"url":"https://api.github.com/repos/groupbuddies/bitreserve","forks_url":"https://api.github.com/repos/groupbuddies/bitreserve/forks","keys_url":"https://api.github.com/repos/groupbuddies/bitreserve/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groupbuddies/bitreserve/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groupbuddies/bitreserve/teams","hooks_url":"https://api.github.com/repos/groupbuddies/bitreserve/hooks","issue_events_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/events{/number}","events_url":"https://api.github.com/repos/groupbuddies/bitreserve/events","assignees_url":"https://api.github.com/repos/groupbuddies/bitreserve/assignees{/user}","branches_url":"https://api.github.com/repos/groupbuddies/bitreserve/branches{/branch}","tags_url":"https://api.github.com/repos/groupbuddies/bitreserve/tags","blobs_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/refs{/sha}","trees_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groupbuddies/bitreserve/statuses/{sha}","languages_url":"https://api.github.com/repos/groupbuddies/bitreserve/languages","stargazers_url":"https://api.github.com/repos/groupbuddies/bitreserve/stargazers","contributors_url":"https://api.github.com/repos/groupbuddies/bitreserve/contributors","subscribers_url":"https://api.github.com/repos/groupbuddies/bitreserve/subscribers","subscription_url":"https://api.github.com/repos/groupbuddies/bitreserve/subscription","commits_url":"https://api.github.com/repos/groupbuddies/bitreserve/commits{/sha}","git_commits_url":"https://api.github.com/repos/groupbuddies/bitreserve/git/commits{/sha}","comments_url":"https://api.github.com/repos/groupbuddies/bitreserve/comments{/number}","issue_comment_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues/comments/{number}","contents_url":"https://api.github.com/repos/groupbuddies/bitreserve/contents/{+path}","compare_url":"https://api.github.com/repos/groupbuddies/bitreserve/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groupbuddies/bitreserve/merges","archive_url":"https://api.github.com/repos/groupbuddies/bitreserve/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groupbuddies/bitreserve/downloads","issues_url":"https://api.github.com/repos/groupbuddies/bitreserve/issues{/number}","pulls_url":"https://api.github.com/repos/groupbuddies/bitreserve/pulls{/number}","milestones_url":"https://api.github.com/repos/groupbuddies/bitreserve/milestones{/number}","notifications_url":"https://api.github.com/repos/groupbuddies/bitreserve/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groupbuddies/bitreserve/labels{/name}","releases_url":"https://api.github.com/repos/groupbuddies/bitreserve/releases{/id}","created_at":"2015-01-22T15:09:41Z","updated_at":"2015-02-09T14:54:44Z","pushed_at":"2015-02-18T11:28:45Z","git_url":"git://github.com/groupbuddies/bitreserve.git","ssh_url":"git@github.com:groupbuddies/bitreserve.git","clone_url":"https://github.com/groupbuddies/bitreserve.git","svn_url":"https://github.com/groupbuddies/bitreserve","homepage":null,"size":901,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39"},"html":{"href":"https://github.com/groupbuddies/bitreserve/pull/39"},"issue":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/issues/39"},"comments":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/groupbuddies/bitreserve/statuses/7c58a0ba146688681f43ea541160802bc86e8f0d"}}}}