{"action":"created","comment":{"url":"https://api.github.com/repos/Edools/hermes/pulls/comments/74318030","id":74318030,"diff_hunk":"@@ -1,13 +1,29 @@\n require \"hermes/engine\"\n \n module Hermes\n-  def self.send_message(event, owner, params = {})\n+  def self.send_message(event, user, owner, params = {})\n     integrations = Hermes::Integration.where(owner: owner, active: true)\n \n+    params_method = merge_with_params(params, user, owner, event)\n+\n     integrations.each do |integration|\n       if integration.active_event?(event)\n-        integration.send(event, params)\n+        integration.send(event, params_method)\n       end\n     end\n   end\n+\n+  def self.merge_with_params(params, user, owner, event)","path":"lib/hermes.rb","position":18,"original_position":18,"commit_id":"33b061fde19c0509f72fa3a0d580faab28fa5a06","original_commit_id":"33b061fde19c0509f72fa3a0d580faab28fa5a06","user":{"login":"williamsbelchior","id":1562732,"avatar_url":"https://avatars.githubusercontent.com/u/1562732?v=3","gravatar_id":"","url":"https://api.github.com/users/williamsbelchior","html_url":"https://github.com/williamsbelchior","followers_url":"https://api.github.com/users/williamsbelchior/followers","following_url":"https://api.github.com/users/williamsbelchior/following{/other_user}","gists_url":"https://api.github.com/users/williamsbelchior/gists{/gist_id}","starred_url":"https://api.github.com/users/williamsbelchior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamsbelchior/subscriptions","organizations_url":"https://api.github.com/users/williamsbelchior/orgs","repos_url":"https://api.github.com/users/williamsbelchior/repos","events_url":"https://api.github.com/users/williamsbelchior/events{/privacy}","received_events_url":"https://api.github.com/users/williamsbelchior/received_events","type":"User","site_admin":false},"body":"Sendo que esse trecho se repete direto pela classe, pode virar um método.\r\n\r\n```\r\nbody.merge!({\r\n  'Produtos' => order.items.to_json,\r\n  'Id dos produtos do pedido'   => order.items.map { |i| i.id},\r\n  'Valor do pedido'    => (order.amount_to_pay / 100).to_f\r\n}) \r\n```\r\n","created_at":"2016-08-10T19:56:21Z","updated_at":"2016-08-10T19:56:21Z","html_url":"https://github.com/Edools/hermes/pull/2#discussion_r74318030","pull_request_url":"https://api.github.com/repos/Edools/hermes/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Edools/hermes/pulls/comments/74318030"},"html":{"href":"https://github.com/Edools/hermes/pull/2#discussion_r74318030"},"pull_request":{"href":"https://api.github.com/repos/Edools/hermes/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Edools/hermes/pulls/2","id":80241955,"html_url":"https://github.com/Edools/hermes/pull/2","diff_url":"https://github.com/Edools/hermes/pull/2.diff","patch_url":"https://github.com/Edools/hermes/pull/2.patch","issue_url":"https://api.github.com/repos/Edools/hermes/issues/2","number":2,"state":"open","locked":false,"title":"Feature/Rd station integration","user":{"login":"mandado","id":2823627,"avatar_url":"https://avatars.githubusercontent.com/u/2823627?v=3","gravatar_id":"","url":"https://api.github.com/users/mandado","html_url":"https://github.com/mandado","followers_url":"https://api.github.com/users/mandado/followers","following_url":"https://api.github.com/users/mandado/following{/other_user}","gists_url":"https://api.github.com/users/mandado/gists{/gist_id}","starred_url":"https://api.github.com/users/mandado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandado/subscriptions","organizations_url":"https://api.github.com/users/mandado/orgs","repos_url":"https://api.github.com/users/mandado/repos","events_url":"https://api.github.com/users/mandado/events{/privacy}","received_events_url":"https://api.github.com/users/mandado/received_events","type":"User","site_admin":false},"body":"Adicionado user param no método send_message\r\nCorreção dos testes por causa da mudança da assinatura do método `send_message`\r\nAdicionado model RdStation com os métodos a serem chamado pelo `send_message`\r\nCriado service que realiza a chamada pra api do RdStation\r\nCriado testes para o model RdStation chamando o service para mandar pro RdStation.","created_at":"2016-08-05T13:20:29Z","updated_at":"2016-08-10T19:56:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d5bd2b0f3a17be54177a6d250d834a878601d8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Edools/hermes/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Edools/hermes/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Edools/hermes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Edools/hermes/issues/2/comments","statuses_url":"https://api.github.com/repos/Edools/hermes/statuses/33b061fde19c0509f72fa3a0d580faab28fa5a06","head":{"label":"Edools:feature/rd-station-integration","ref":"feature/rd-station-integration","sha":"33b061fde19c0509f72fa3a0d580faab28fa5a06","user":{"login":"Edools","id":6585846,"avatar_url":"https://avatars.githubusercontent.com/u/6585846?v=3","gravatar_id":"","url":"https://api.github.com/users/Edools","html_url":"https://github.com/Edools","followers_url":"https://api.github.com/users/Edools/followers","following_url":"https://api.github.com/users/Edools/following{/other_user}","gists_url":"https://api.github.com/users/Edools/gists{/gist_id}","starred_url":"https://api.github.com/users/Edools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edools/subscriptions","organizations_url":"https://api.github.com/users/Edools/orgs","repos_url":"https://api.github.com/users/Edools/repos","events_url":"https://api.github.com/users/Edools/events{/privacy}","received_events_url":"https://api.github.com/users/Edools/received_events","type":"Organization","site_admin":false},"repo":{"id":63098755,"name":"hermes","full_name":"Edools/hermes","owner":{"login":"Edools","id":6585846,"avatar_url":"https://avatars.githubusercontent.com/u/6585846?v=3","gravatar_id":"","url":"https://api.github.com/users/Edools","html_url":"https://github.com/Edools","followers_url":"https://api.github.com/users/Edools/followers","following_url":"https://api.github.com/users/Edools/following{/other_user}","gists_url":"https://api.github.com/users/Edools/gists{/gist_id}","starred_url":"https://api.github.com/users/Edools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edools/subscriptions","organizations_url":"https://api.github.com/users/Edools/orgs","repos_url":"https://api.github.com/users/Edools/repos","events_url":"https://api.github.com/users/Edools/events{/privacy}","received_events_url":"https://api.github.com/users/Edools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Edools/hermes","description":null,"fork":false,"url":"https://api.github.com/repos/Edools/hermes","forks_url":"https://api.github.com/repos/Edools/hermes/forks","keys_url":"https://api.github.com/repos/Edools/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Edools/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Edools/hermes/teams","hooks_url":"https://api.github.com/repos/Edools/hermes/hooks","issue_events_url":"https://api.github.com/repos/Edools/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/Edools/hermes/events","assignees_url":"https://api.github.com/repos/Edools/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/Edools/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/Edools/hermes/tags","blobs_url":"https://api.github.com/repos/Edools/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Edools/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Edools/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Edools/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Edools/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/Edools/hermes/languages","stargazers_url":"https://api.github.com/repos/Edools/hermes/stargazers","contributors_url":"https://api.github.com/repos/Edools/hermes/contributors","subscribers_url":"https://api.github.com/repos/Edools/hermes/subscribers","subscription_url":"https://api.github.com/repos/Edools/hermes/subscription","commits_url":"https://api.github.com/repos/Edools/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Edools/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Edools/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Edools/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Edools/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/Edools/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Edools/hermes/merges","archive_url":"https://api.github.com/repos/Edools/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Edools/hermes/downloads","issues_url":"https://api.github.com/repos/Edools/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/Edools/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/Edools/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/Edools/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Edools/hermes/labels{/name}","releases_url":"https://api.github.com/repos/Edools/hermes/releases{/id}","deployments_url":"https://api.github.com/repos/Edools/hermes/deployments","created_at":"2016-07-11T20:11:58Z","updated_at":"2016-07-11T20:14:40Z","pushed_at":"2016-08-10T17:58:24Z","git_url":"git://github.com/Edools/hermes.git","ssh_url":"git@github.com:Edools/hermes.git","clone_url":"https://github.com/Edools/hermes.git","svn_url":"https://github.com/Edools/hermes","homepage":null,"size":44,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Edools:master","ref":"master","sha":"9029557119601223b9ba65142cef99179524777f","user":{"login":"Edools","id":6585846,"avatar_url":"https://avatars.githubusercontent.com/u/6585846?v=3","gravatar_id":"","url":"https://api.github.com/users/Edools","html_url":"https://github.com/Edools","followers_url":"https://api.github.com/users/Edools/followers","following_url":"https://api.github.com/users/Edools/following{/other_user}","gists_url":"https://api.github.com/users/Edools/gists{/gist_id}","starred_url":"https://api.github.com/users/Edools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edools/subscriptions","organizations_url":"https://api.github.com/users/Edools/orgs","repos_url":"https://api.github.com/users/Edools/repos","events_url":"https://api.github.com/users/Edools/events{/privacy}","received_events_url":"https://api.github.com/users/Edools/received_events","type":"Organization","site_admin":false},"repo":{"id":63098755,"name":"hermes","full_name":"Edools/hermes","owner":{"login":"Edools","id":6585846,"avatar_url":"https://avatars.githubusercontent.com/u/6585846?v=3","gravatar_id":"","url":"https://api.github.com/users/Edools","html_url":"https://github.com/Edools","followers_url":"https://api.github.com/users/Edools/followers","following_url":"https://api.github.com/users/Edools/following{/other_user}","gists_url":"https://api.github.com/users/Edools/gists{/gist_id}","starred_url":"https://api.github.com/users/Edools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edools/subscriptions","organizations_url":"https://api.github.com/users/Edools/orgs","repos_url":"https://api.github.com/users/Edools/repos","events_url":"https://api.github.com/users/Edools/events{/privacy}","received_events_url":"https://api.github.com/users/Edools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Edools/hermes","description":null,"fork":false,"url":"https://api.github.com/repos/Edools/hermes","forks_url":"https://api.github.com/repos/Edools/hermes/forks","keys_url":"https://api.github.com/repos/Edools/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Edools/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Edools/hermes/teams","hooks_url":"https://api.github.com/repos/Edools/hermes/hooks","issue_events_url":"https://api.github.com/repos/Edools/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/Edools/hermes/events","assignees_url":"https://api.github.com/repos/Edools/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/Edools/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/Edools/hermes/tags","blobs_url":"https://api.github.com/repos/Edools/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Edools/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Edools/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Edools/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Edools/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/Edools/hermes/languages","stargazers_url":"https://api.github.com/repos/Edools/hermes/stargazers","contributors_url":"https://api.github.com/repos/Edools/hermes/contributors","subscribers_url":"https://api.github.com/repos/Edools/hermes/subscribers","subscription_url":"https://api.github.com/repos/Edools/hermes/subscription","commits_url":"https://api.github.com/repos/Edools/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Edools/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Edools/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Edools/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Edools/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/Edools/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Edools/hermes/merges","archive_url":"https://api.github.com/repos/Edools/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Edools/hermes/downloads","issues_url":"https://api.github.com/repos/Edools/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/Edools/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/Edools/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/Edools/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Edools/hermes/labels{/name}","releases_url":"https://api.github.com/repos/Edools/hermes/releases{/id}","deployments_url":"https://api.github.com/repos/Edools/hermes/deployments","created_at":"2016-07-11T20:11:58Z","updated_at":"2016-07-11T20:14:40Z","pushed_at":"2016-08-10T17:58:24Z","git_url":"git://github.com/Edools/hermes.git","ssh_url":"git@github.com:Edools/hermes.git","clone_url":"https://github.com/Edools/hermes.git","svn_url":"https://github.com/Edools/hermes","homepage":null,"size":44,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Edools/hermes/pulls/2"},"html":{"href":"https://github.com/Edools/hermes/pull/2"},"issue":{"href":"https://api.github.com/repos/Edools/hermes/issues/2"},"comments":{"href":"https://api.github.com/repos/Edools/hermes/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Edools/hermes/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Edools/hermes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Edools/hermes/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Edools/hermes/statuses/33b061fde19c0509f72fa3a0d580faab28fa5a06"}}}}
{"actor":{"display_login":"williamsbelchior"}}