{"action":"created","comment":{"url":"https://api.github.com/repos/Skookum/eventum/pulls/comments/39199150","id":39199150,"diff_hunk":"@@ -40,11 +60,31 @@ def conn(config)\n     # @return [Hash]\n     #\n     # @api private\n-    def headers\n+    def default_headers\n       {\n         ACCEPT:       \"application/json\".freeze,\n         CONTENT_TYPE: \"application/json\".freeze\n       }\n     end\n+\n+    # Utility method used to rebuild the request on each call\n+    #\n+    # @param method [Symbol] the HTTP method to perform\n+    # @param path [String] the path of the URL endpoint to request\n+    # @params body [Hash] the body of the request\n+    # @param headers [Hash] the headers of the request\n+    #\n+    # @return [Eventum::Connection::Request]\n+    #\n+    # @api private\n+    def rebuild_request(method, path, body, headers)\n+      @request = Eventum::Connection::Request.new(\n+        method:  method,\n+        path:    path,\n+        body:    body,","path":"lib/eventum/connection.rb","position":95,"original_position":95,"commit_id":"082ddf1d894006895f43f2d49b2932d7b094090e","original_commit_id":"082ddf1d894006895f43f2d49b2932d7b094090e","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Unnecessary spacing detected.","created_at":"2015-09-10T18:56:58Z","updated_at":"2015-09-10T18:56:58Z","html_url":"https://github.com/Skookum/eventum/pull/1#discussion_r39199150","pull_request_url":"https://api.github.com/repos/Skookum/eventum/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Skookum/eventum/pulls/comments/39199150"},"html":{"href":"https://github.com/Skookum/eventum/pull/1#discussion_r39199150"},"pull_request":{"href":"https://api.github.com/repos/Skookum/eventum/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Skookum/eventum/pulls/1","id":44692317,"html_url":"https://github.com/Skookum/eventum/pull/1","diff_url":"https://github.com/Skookum/eventum/pull/1.diff","patch_url":"https://github.com/Skookum/eventum/pull/1.patch","issue_url":"https://api.github.com/repos/Skookum/eventum/issues/1","number":1,"state":"open","locked":false,"title":"Ability to write events to a given stream","user":{"login":"Enriikke","id":1388106,"avatar_url":"https://avatars.githubusercontent.com/u/1388106?v=3","gravatar_id":"","url":"https://api.github.com/users/Enriikke","html_url":"https://github.com/Enriikke","followers_url":"https://api.github.com/users/Enriikke/followers","following_url":"https://api.github.com/users/Enriikke/following{/other_user}","gists_url":"https://api.github.com/users/Enriikke/gists{/gist_id}","starred_url":"https://api.github.com/users/Enriikke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enriikke/subscriptions","organizations_url":"https://api.github.com/users/Enriikke/orgs","repos_url":"https://api.github.com/users/Enriikke/repos","events_url":"https://api.github.com/users/Enriikke/events{/privacy}","received_events_url":"https://api.github.com/users/Enriikke/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nThis PR introduces a new feature that allows clients to write a single event to a given stream.\r\n\r\n```ruby\r\n#################\r\n# Example Usage #\r\n#################\r\n\r\ntype = \"event-type\"\r\nbody = { data: \"event data\" }\r\n\r\nclient = Eventum.new\r\nclient.events.create(\"stream-name\", type: type, body: body)\r\n```\r\n\r\n## Changes\r\n\r\n### 1. Eventum::Client::Events\r\n* Added a `#create` method that can be used to write an event. It requires a `stream name`, `event type`, and the `event body` to be written.\r\n\r\n### 2. Eventum::API\r\n* Added a `#post` method that can be consumed by all API clients to send HTTP POST request. It expects a `path` parameter and can optionally take `body` and `headers` values.\r\n\r\n### 3. Eventum::Connection::Request\r\n* Introduced a new request object to hold individual HTTP request properties.\r\n","created_at":"2015-09-10T16:55:16Z","updated_at":"2015-09-10T18:56:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20b5bd77b8001acf1fa65a1626f72837cd9ddf2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Skookum/eventum/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Skookum/eventum/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Skookum/eventum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Skookum/eventum/issues/1/comments","statuses_url":"https://api.github.com/repos/Skookum/eventum/statuses/082ddf1d894006895f43f2d49b2932d7b094090e","head":{"label":"Skookum:features/create-event","ref":"features/create-event","sha":"082ddf1d894006895f43f2d49b2932d7b094090e","user":{"login":"Skookum","id":314568,"avatar_url":"https://avatars.githubusercontent.com/u/314568?v=3","gravatar_id":"","url":"https://api.github.com/users/Skookum","html_url":"https://github.com/Skookum","followers_url":"https://api.github.com/users/Skookum/followers","following_url":"https://api.github.com/users/Skookum/following{/other_user}","gists_url":"https://api.github.com/users/Skookum/gists{/gist_id}","starred_url":"https://api.github.com/users/Skookum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skookum/subscriptions","organizations_url":"https://api.github.com/users/Skookum/orgs","repos_url":"https://api.github.com/users/Skookum/repos","events_url":"https://api.github.com/users/Skookum/events{/privacy}","received_events_url":"https://api.github.com/users/Skookum/received_events","type":"Organization","site_admin":false},"repo":{"id":42139894,"name":"eventum","full_name":"Skookum/eventum","owner":{"login":"Skookum","id":314568,"avatar_url":"https://avatars.githubusercontent.com/u/314568?v=3","gravatar_id":"","url":"https://api.github.com/users/Skookum","html_url":"https://github.com/Skookum","followers_url":"https://api.github.com/users/Skookum/followers","following_url":"https://api.github.com/users/Skookum/following{/other_user}","gists_url":"https://api.github.com/users/Skookum/gists{/gist_id}","starred_url":"https://api.github.com/users/Skookum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skookum/subscriptions","organizations_url":"https://api.github.com/users/Skookum/orgs","repos_url":"https://api.github.com/users/Skookum/repos","events_url":"https://api.github.com/users/Skookum/events{/privacy}","received_events_url":"https://api.github.com/users/Skookum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skookum/eventum","description":"A Ruby wrapper for the Event Store API.","fork":false,"url":"https://api.github.com/repos/Skookum/eventum","forks_url":"https://api.github.com/repos/Skookum/eventum/forks","keys_url":"https://api.github.com/repos/Skookum/eventum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skookum/eventum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skookum/eventum/teams","hooks_url":"https://api.github.com/repos/Skookum/eventum/hooks","issue_events_url":"https://api.github.com/repos/Skookum/eventum/issues/events{/number}","events_url":"https://api.github.com/repos/Skookum/eventum/events","assignees_url":"https://api.github.com/repos/Skookum/eventum/assignees{/user}","branches_url":"https://api.github.com/repos/Skookum/eventum/branches{/branch}","tags_url":"https://api.github.com/repos/Skookum/eventum/tags","blobs_url":"https://api.github.com/repos/Skookum/eventum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skookum/eventum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skookum/eventum/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skookum/eventum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skookum/eventum/statuses/{sha}","languages_url":"https://api.github.com/repos/Skookum/eventum/languages","stargazers_url":"https://api.github.com/repos/Skookum/eventum/stargazers","contributors_url":"https://api.github.com/repos/Skookum/eventum/contributors","subscribers_url":"https://api.github.com/repos/Skookum/eventum/subscribers","subscription_url":"https://api.github.com/repos/Skookum/eventum/subscription","commits_url":"https://api.github.com/repos/Skookum/eventum/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skookum/eventum/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skookum/eventum/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skookum/eventum/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skookum/eventum/contents/{+path}","compare_url":"https://api.github.com/repos/Skookum/eventum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skookum/eventum/merges","archive_url":"https://api.github.com/repos/Skookum/eventum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skookum/eventum/downloads","issues_url":"https://api.github.com/repos/Skookum/eventum/issues{/number}","pulls_url":"https://api.github.com/repos/Skookum/eventum/pulls{/number}","milestones_url":"https://api.github.com/repos/Skookum/eventum/milestones{/number}","notifications_url":"https://api.github.com/repos/Skookum/eventum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skookum/eventum/labels{/name}","releases_url":"https://api.github.com/repos/Skookum/eventum/releases{/id}","created_at":"2015-09-08T21:26:07Z","updated_at":"2015-09-08T21:31:43Z","pushed_at":"2015-09-10T18:56:55Z","git_url":"git://github.com/Skookum/eventum.git","ssh_url":"git@github.com:Skookum/eventum.git","clone_url":"https://github.com/Skookum/eventum.git","svn_url":"https://github.com/Skookum/eventum","homepage":null,"size":0,"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":"Skookum:master","ref":"master","sha":"7d7b07e2e49d7536b0238b61b5fee2b7879e3837","user":{"login":"Skookum","id":314568,"avatar_url":"https://avatars.githubusercontent.com/u/314568?v=3","gravatar_id":"","url":"https://api.github.com/users/Skookum","html_url":"https://github.com/Skookum","followers_url":"https://api.github.com/users/Skookum/followers","following_url":"https://api.github.com/users/Skookum/following{/other_user}","gists_url":"https://api.github.com/users/Skookum/gists{/gist_id}","starred_url":"https://api.github.com/users/Skookum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skookum/subscriptions","organizations_url":"https://api.github.com/users/Skookum/orgs","repos_url":"https://api.github.com/users/Skookum/repos","events_url":"https://api.github.com/users/Skookum/events{/privacy}","received_events_url":"https://api.github.com/users/Skookum/received_events","type":"Organization","site_admin":false},"repo":{"id":42139894,"name":"eventum","full_name":"Skookum/eventum","owner":{"login":"Skookum","id":314568,"avatar_url":"https://avatars.githubusercontent.com/u/314568?v=3","gravatar_id":"","url":"https://api.github.com/users/Skookum","html_url":"https://github.com/Skookum","followers_url":"https://api.github.com/users/Skookum/followers","following_url":"https://api.github.com/users/Skookum/following{/other_user}","gists_url":"https://api.github.com/users/Skookum/gists{/gist_id}","starred_url":"https://api.github.com/users/Skookum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skookum/subscriptions","organizations_url":"https://api.github.com/users/Skookum/orgs","repos_url":"https://api.github.com/users/Skookum/repos","events_url":"https://api.github.com/users/Skookum/events{/privacy}","received_events_url":"https://api.github.com/users/Skookum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skookum/eventum","description":"A Ruby wrapper for the Event Store API.","fork":false,"url":"https://api.github.com/repos/Skookum/eventum","forks_url":"https://api.github.com/repos/Skookum/eventum/forks","keys_url":"https://api.github.com/repos/Skookum/eventum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skookum/eventum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skookum/eventum/teams","hooks_url":"https://api.github.com/repos/Skookum/eventum/hooks","issue_events_url":"https://api.github.com/repos/Skookum/eventum/issues/events{/number}","events_url":"https://api.github.com/repos/Skookum/eventum/events","assignees_url":"https://api.github.com/repos/Skookum/eventum/assignees{/user}","branches_url":"https://api.github.com/repos/Skookum/eventum/branches{/branch}","tags_url":"https://api.github.com/repos/Skookum/eventum/tags","blobs_url":"https://api.github.com/repos/Skookum/eventum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skookum/eventum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skookum/eventum/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skookum/eventum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skookum/eventum/statuses/{sha}","languages_url":"https://api.github.com/repos/Skookum/eventum/languages","stargazers_url":"https://api.github.com/repos/Skookum/eventum/stargazers","contributors_url":"https://api.github.com/repos/Skookum/eventum/contributors","subscribers_url":"https://api.github.com/repos/Skookum/eventum/subscribers","subscription_url":"https://api.github.com/repos/Skookum/eventum/subscription","commits_url":"https://api.github.com/repos/Skookum/eventum/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skookum/eventum/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skookum/eventum/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skookum/eventum/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skookum/eventum/contents/{+path}","compare_url":"https://api.github.com/repos/Skookum/eventum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skookum/eventum/merges","archive_url":"https://api.github.com/repos/Skookum/eventum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skookum/eventum/downloads","issues_url":"https://api.github.com/repos/Skookum/eventum/issues{/number}","pulls_url":"https://api.github.com/repos/Skookum/eventum/pulls{/number}","milestones_url":"https://api.github.com/repos/Skookum/eventum/milestones{/number}","notifications_url":"https://api.github.com/repos/Skookum/eventum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skookum/eventum/labels{/name}","releases_url":"https://api.github.com/repos/Skookum/eventum/releases{/id}","created_at":"2015-09-08T21:26:07Z","updated_at":"2015-09-08T21:31:43Z","pushed_at":"2015-09-10T18:56:55Z","git_url":"git://github.com/Skookum/eventum.git","ssh_url":"git@github.com:Skookum/eventum.git","clone_url":"https://github.com/Skookum/eventum.git","svn_url":"https://github.com/Skookum/eventum","homepage":null,"size":0,"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/Skookum/eventum/pulls/1"},"html":{"href":"https://github.com/Skookum/eventum/pull/1"},"issue":{"href":"https://api.github.com/repos/Skookum/eventum/issues/1"},"comments":{"href":"https://api.github.com/repos/Skookum/eventum/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Skookum/eventum/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Skookum/eventum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Skookum/eventum/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Skookum/eventum/statuses/082ddf1d894006895f43f2d49b2932d7b094090e"}}}}