{"action":"created","comment":{"url":"https://api.github.com/repos/pagseguro/ruby/pulls/comments/53023554","id":53023554,"diff_hunk":"@@ -0,0 +1,34 @@\n+module PagSeguro\n+  module Extensions\n+    module CollectionObject\n+      extend Forwardable\n+      include Enumerable\n+      include EnsureType\n+\n+      def_delegators :@store, :size, :clear, :empty?, :any?, :each, :include?\n+\n+      attr_accessor :store\n+\n+      def initialize\n+        @store = []\n+      end\n+\n+      def collection_type\n+        PagSeguro.const_get(class_name_singularized)\n+      end\n+\n+      # Adds a new object to the collection.\n+      def <<(param)\n+        object = ensure_type(collection_type, param)\n+        @store << object unless include?(object)\n+      end\n+\n+      private\n+\n+      def class_name_singularized\n+        class_name = self.class.to_s.split('::').last\n+        class_name.chars.to_a.slice(0...-1).join if class_name.end_with? 's'","path":"lib/pagseguro/extensions/collection_object.rb","position":30,"original_position":30,"commit_id":"312b55965722e0206f5f930c90b7ee69dc392020","original_commit_id":"312b55965722e0206f5f930c90b7ee69dc392020","user":{"login":"akitaonrails","id":2840,"avatar_url":"https://avatars.githubusercontent.com/u/2840?v=3","gravatar_id":"","url":"https://api.github.com/users/akitaonrails","html_url":"https://github.com/akitaonrails","followers_url":"https://api.github.com/users/akitaonrails/followers","following_url":"https://api.github.com/users/akitaonrails/following{/other_user}","gists_url":"https://api.github.com/users/akitaonrails/gists{/gist_id}","starred_url":"https://api.github.com/users/akitaonrails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akitaonrails/subscriptions","organizations_url":"https://api.github.com/users/akitaonrails/orgs","repos_url":"https://api.github.com/users/akitaonrails/repos","events_url":"https://api.github.com/users/akitaonrails/events{/privacy}","received_events_url":"https://api.github.com/users/akitaonrails/received_events","type":"User","site_admin":false},"body":"```\r\ndef class_name_singularized\r\n  class_name[-1, 1] == suffix\r\nend\r\n```\r\nnão é beeeem um \"singularized\" já que não vai tratar inflexões, mas tá ...","created_at":"2016-02-16T15:16:17Z","updated_at":"2016-02-16T15:16:17Z","html_url":"https://github.com/pagseguro/ruby/pull/187#discussion_r53023554","pull_request_url":"https://api.github.com/repos/pagseguro/ruby/pulls/187","_links":{"self":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/comments/53023554"},"html":{"href":"https://github.com/pagseguro/ruby/pull/187#discussion_r53023554"},"pull_request":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/187"}}},"pull_request":{"url":"https://api.github.com/repos/pagseguro/ruby/pulls/187","id":59391199,"html_url":"https://github.com/pagseguro/ruby/pull/187","diff_url":"https://github.com/pagseguro/ruby/pull/187.diff","patch_url":"https://github.com/pagseguro/ruby/pull/187.patch","issue_url":"https://api.github.com/repos/pagseguro/ruby/issues/187","number":187,"state":"open","locked":false,"title":"Create module Collection Object","user":{"login":"rafaelrpbelo","id":2837358,"avatar_url":"https://avatars.githubusercontent.com/u/2837358?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelrpbelo","html_url":"https://github.com/rafaelrpbelo","followers_url":"https://api.github.com/users/rafaelrpbelo/followers","following_url":"https://api.github.com/users/rafaelrpbelo/following{/other_user}","gists_url":"https://api.github.com/users/rafaelrpbelo/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelrpbelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelrpbelo/subscriptions","organizations_url":"https://api.github.com/users/rafaelrpbelo/orgs","repos_url":"https://api.github.com/users/rafaelrpbelo/repos","events_url":"https://api.github.com/users/rafaelrpbelo/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelrpbelo/received_events","type":"User","site_admin":false},"body":"#### Other suggested solution about the problem open in https://github.com/pagseguro/ruby/pull/185\r\n","created_at":"2016-02-15T17:10:47Z","updated_at":"2016-02-16T15:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"481d4523fd8b046b38d0f777e7c44f81d2c3346e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pagseguro/ruby/pulls/187/commits","review_comments_url":"https://api.github.com/repos/pagseguro/ruby/pulls/187/comments","review_comment_url":"https://api.github.com/repos/pagseguro/ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pagseguro/ruby/issues/187/comments","statuses_url":"https://api.github.com/repos/pagseguro/ruby/statuses/312b55965722e0206f5f930c90b7ee69dc392020","head":{"label":"pagseguro:2.5.0-dev-collection-objects","ref":"2.5.0-dev-collection-objects","sha":"312b55965722e0206f5f930c90b7ee69dc392020","user":{"login":"pagseguro","id":123060,"avatar_url":"https://avatars.githubusercontent.com/u/123060?v=3","gravatar_id":"","url":"https://api.github.com/users/pagseguro","html_url":"https://github.com/pagseguro","followers_url":"https://api.github.com/users/pagseguro/followers","following_url":"https://api.github.com/users/pagseguro/following{/other_user}","gists_url":"https://api.github.com/users/pagseguro/gists{/gist_id}","starred_url":"https://api.github.com/users/pagseguro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagseguro/subscriptions","organizations_url":"https://api.github.com/users/pagseguro/orgs","repos_url":"https://api.github.com/users/pagseguro/repos","events_url":"https://api.github.com/users/pagseguro/events{/privacy}","received_events_url":"https://api.github.com/users/pagseguro/received_events","type":"Organization","site_admin":false},"repo":{"id":9632355,"name":"ruby","full_name":"pagseguro/ruby","owner":{"login":"pagseguro","id":123060,"avatar_url":"https://avatars.githubusercontent.com/u/123060?v=3","gravatar_id":"","url":"https://api.github.com/users/pagseguro","html_url":"https://github.com/pagseguro","followers_url":"https://api.github.com/users/pagseguro/followers","following_url":"https://api.github.com/users/pagseguro/following{/other_user}","gists_url":"https://api.github.com/users/pagseguro/gists{/gist_id}","starred_url":"https://api.github.com/users/pagseguro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagseguro/subscriptions","organizations_url":"https://api.github.com/users/pagseguro/orgs","repos_url":"https://api.github.com/users/pagseguro/repos","events_url":"https://api.github.com/users/pagseguro/events{/privacy}","received_events_url":"https://api.github.com/users/pagseguro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pagseguro/ruby","description":"Biblioteca de integração em Ruby","fork":false,"url":"https://api.github.com/repos/pagseguro/ruby","forks_url":"https://api.github.com/repos/pagseguro/ruby/forks","keys_url":"https://api.github.com/repos/pagseguro/ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pagseguro/ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pagseguro/ruby/teams","hooks_url":"https://api.github.com/repos/pagseguro/ruby/hooks","issue_events_url":"https://api.github.com/repos/pagseguro/ruby/issues/events{/number}","events_url":"https://api.github.com/repos/pagseguro/ruby/events","assignees_url":"https://api.github.com/repos/pagseguro/ruby/assignees{/user}","branches_url":"https://api.github.com/repos/pagseguro/ruby/branches{/branch}","tags_url":"https://api.github.com/repos/pagseguro/ruby/tags","blobs_url":"https://api.github.com/repos/pagseguro/ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pagseguro/ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pagseguro/ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/pagseguro/ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pagseguro/ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/pagseguro/ruby/languages","stargazers_url":"https://api.github.com/repos/pagseguro/ruby/stargazers","contributors_url":"https://api.github.com/repos/pagseguro/ruby/contributors","subscribers_url":"https://api.github.com/repos/pagseguro/ruby/subscribers","subscription_url":"https://api.github.com/repos/pagseguro/ruby/subscription","commits_url":"https://api.github.com/repos/pagseguro/ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/pagseguro/ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/pagseguro/ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/pagseguro/ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/pagseguro/ruby/contents/{+path}","compare_url":"https://api.github.com/repos/pagseguro/ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pagseguro/ruby/merges","archive_url":"https://api.github.com/repos/pagseguro/ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pagseguro/ruby/downloads","issues_url":"https://api.github.com/repos/pagseguro/ruby/issues{/number}","pulls_url":"https://api.github.com/repos/pagseguro/ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/pagseguro/ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/pagseguro/ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pagseguro/ruby/labels{/name}","releases_url":"https://api.github.com/repos/pagseguro/ruby/releases{/id}","deployments_url":"https://api.github.com/repos/pagseguro/ruby/deployments","created_at":"2013-04-23T20:14:45Z","updated_at":"2016-01-27T18:26:45Z","pushed_at":"2016-02-15T18:24:12Z","git_url":"git://github.com/pagseguro/ruby.git","ssh_url":"git@github.com:pagseguro/ruby.git","clone_url":"https://github.com/pagseguro/ruby.git","svn_url":"https://github.com/pagseguro/ruby","homepage":"","size":916,"stargazers_count":70,"watchers_count":70,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":6,"forks":53,"open_issues":6,"watchers":70,"default_branch":"master"}},"base":{"label":"pagseguro:2.5.0-dev","ref":"2.5.0-dev","sha":"c5a4a5cd245d73476dd7e615b1b9d096a91477a2","user":{"login":"pagseguro","id":123060,"avatar_url":"https://avatars.githubusercontent.com/u/123060?v=3","gravatar_id":"","url":"https://api.github.com/users/pagseguro","html_url":"https://github.com/pagseguro","followers_url":"https://api.github.com/users/pagseguro/followers","following_url":"https://api.github.com/users/pagseguro/following{/other_user}","gists_url":"https://api.github.com/users/pagseguro/gists{/gist_id}","starred_url":"https://api.github.com/users/pagseguro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagseguro/subscriptions","organizations_url":"https://api.github.com/users/pagseguro/orgs","repos_url":"https://api.github.com/users/pagseguro/repos","events_url":"https://api.github.com/users/pagseguro/events{/privacy}","received_events_url":"https://api.github.com/users/pagseguro/received_events","type":"Organization","site_admin":false},"repo":{"id":9632355,"name":"ruby","full_name":"pagseguro/ruby","owner":{"login":"pagseguro","id":123060,"avatar_url":"https://avatars.githubusercontent.com/u/123060?v=3","gravatar_id":"","url":"https://api.github.com/users/pagseguro","html_url":"https://github.com/pagseguro","followers_url":"https://api.github.com/users/pagseguro/followers","following_url":"https://api.github.com/users/pagseguro/following{/other_user}","gists_url":"https://api.github.com/users/pagseguro/gists{/gist_id}","starred_url":"https://api.github.com/users/pagseguro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagseguro/subscriptions","organizations_url":"https://api.github.com/users/pagseguro/orgs","repos_url":"https://api.github.com/users/pagseguro/repos","events_url":"https://api.github.com/users/pagseguro/events{/privacy}","received_events_url":"https://api.github.com/users/pagseguro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pagseguro/ruby","description":"Biblioteca de integração em Ruby","fork":false,"url":"https://api.github.com/repos/pagseguro/ruby","forks_url":"https://api.github.com/repos/pagseguro/ruby/forks","keys_url":"https://api.github.com/repos/pagseguro/ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pagseguro/ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pagseguro/ruby/teams","hooks_url":"https://api.github.com/repos/pagseguro/ruby/hooks","issue_events_url":"https://api.github.com/repos/pagseguro/ruby/issues/events{/number}","events_url":"https://api.github.com/repos/pagseguro/ruby/events","assignees_url":"https://api.github.com/repos/pagseguro/ruby/assignees{/user}","branches_url":"https://api.github.com/repos/pagseguro/ruby/branches{/branch}","tags_url":"https://api.github.com/repos/pagseguro/ruby/tags","blobs_url":"https://api.github.com/repos/pagseguro/ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pagseguro/ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pagseguro/ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/pagseguro/ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pagseguro/ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/pagseguro/ruby/languages","stargazers_url":"https://api.github.com/repos/pagseguro/ruby/stargazers","contributors_url":"https://api.github.com/repos/pagseguro/ruby/contributors","subscribers_url":"https://api.github.com/repos/pagseguro/ruby/subscribers","subscription_url":"https://api.github.com/repos/pagseguro/ruby/subscription","commits_url":"https://api.github.com/repos/pagseguro/ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/pagseguro/ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/pagseguro/ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/pagseguro/ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/pagseguro/ruby/contents/{+path}","compare_url":"https://api.github.com/repos/pagseguro/ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pagseguro/ruby/merges","archive_url":"https://api.github.com/repos/pagseguro/ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pagseguro/ruby/downloads","issues_url":"https://api.github.com/repos/pagseguro/ruby/issues{/number}","pulls_url":"https://api.github.com/repos/pagseguro/ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/pagseguro/ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/pagseguro/ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pagseguro/ruby/labels{/name}","releases_url":"https://api.github.com/repos/pagseguro/ruby/releases{/id}","deployments_url":"https://api.github.com/repos/pagseguro/ruby/deployments","created_at":"2013-04-23T20:14:45Z","updated_at":"2016-01-27T18:26:45Z","pushed_at":"2016-02-15T18:24:12Z","git_url":"git://github.com/pagseguro/ruby.git","ssh_url":"git@github.com:pagseguro/ruby.git","clone_url":"https://github.com/pagseguro/ruby.git","svn_url":"https://github.com/pagseguro/ruby","homepage":"","size":916,"stargazers_count":70,"watchers_count":70,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":6,"forks":53,"open_issues":6,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/187"},"html":{"href":"https://github.com/pagseguro/ruby/pull/187"},"issue":{"href":"https://api.github.com/repos/pagseguro/ruby/issues/187"},"comments":{"href":"https://api.github.com/repos/pagseguro/ruby/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pagseguro/ruby/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/pagseguro/ruby/statuses/312b55965722e0206f5f930c90b7ee69dc392020"}}}}