{"action":"created","comment":{"url":"https://api.github.com/repos/vermartian/toy-chess/pulls/comments/52423817","id":52423817,"diff_hunk":"@@ -7,11 +7,39 @@ def vectors(vectors = [])\n     @vectors ||= vectors\n   end\n \n-  def move(x, y)\n-    if self.move_capable?(position)\n-      @x = x\n-      @y = y\n+  def move(params)\n+    xpos = params[:x].to_i\n+    ypos = params[:y].to_i\n+    channel = \"public-conversation\"\n+    if game.piece_at?(xpos, ypos)\n+      captured_piece = game.piece_at(xpos, ypos)\n+      captured_piece_fig = captured_piece.figure\n+      captured_piece.update_attributes(x: 8, y:8, state: 'off')\n+      Pusher.trigger(channel, 'move_event', {\n+        piece: captured_piece,\n+        fig: captured_piece_fig\n+      })\n     end\n+    if type == 'King' && (self.x - xpos).abs == 2\n+      if (self.x - xpos) == -2\n+        castle_rook('king').update_attributes(x: 5, state: 'moved')\n+        castle_rook = game.pieces.find_by(type: 'Rook', x: 5, y: self.y)\n+        castle_rook_fig = castle_rook.figure\n+        Pusher.trigger(channel, 'move_event', {\n+          piece: castle_rook,\n+          fig: castle_rook_fig\n+        })\n+      elsif (self.x - xpos) == 2","path":"app/models/piece.rb","position":30,"original_position":30,"commit_id":"10de9c57c2d8f931dcd4c0d367c84dfba1f1f9d5","original_commit_id":"10de9c57c2d8f931dcd4c0d367c84dfba1f1f9d5","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":"Redundant `self` detected.","created_at":"2016-02-10T07:49:09Z","updated_at":"2016-02-10T07:49:09Z","html_url":"https://github.com/vermartian/toy-chess/pull/20#discussion_r52423817","pull_request_url":"https://api.github.com/repos/vermartian/toy-chess/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/vermartian/toy-chess/pulls/comments/52423817"},"html":{"href":"https://github.com/vermartian/toy-chess/pull/20#discussion_r52423817"},"pull_request":{"href":"https://api.github.com/repos/vermartian/toy-chess/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/vermartian/toy-chess/pulls/20","id":58857185,"html_url":"https://github.com/vermartian/toy-chess/pull/20","diff_url":"https://github.com/vermartian/toy-chess/pull/20.diff","patch_url":"https://github.com/vermartian/toy-chess/pull/20.patch","issue_url":"https://api.github.com/repos/vermartian/toy-chess/issues/20","number":20,"state":"open","locked":false,"title":"obstructions, turns, castling","user":{"login":"vermartian","id":14897176,"avatar_url":"https://avatars.githubusercontent.com/u/14897176?v=3","gravatar_id":"","url":"https://api.github.com/users/vermartian","html_url":"https://github.com/vermartian","followers_url":"https://api.github.com/users/vermartian/followers","following_url":"https://api.github.com/users/vermartian/following{/other_user}","gists_url":"https://api.github.com/users/vermartian/gists{/gist_id}","starred_url":"https://api.github.com/users/vermartian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vermartian/subscriptions","organizations_url":"https://api.github.com/users/vermartian/orgs","repos_url":"https://api.github.com/users/vermartian/repos","events_url":"https://api.github.com/users/vermartian/events{/privacy}","received_events_url":"https://api.github.com/users/vermartian/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-10T07:48:43Z","updated_at":"2016-02-10T07:49:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f63b03b3b15cd1266efc265ef89e0077951cffc4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vermartian/toy-chess/pulls/20/commits","review_comments_url":"https://api.github.com/repos/vermartian/toy-chess/pulls/20/comments","review_comment_url":"https://api.github.com/repos/vermartian/toy-chess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vermartian/toy-chess/issues/20/comments","statuses_url":"https://api.github.com/repos/vermartian/toy-chess/statuses/10de9c57c2d8f931dcd4c0d367c84dfba1f1f9d5","head":{"label":"vermartian:path-obstructions","ref":"path-obstructions","sha":"10de9c57c2d8f931dcd4c0d367c84dfba1f1f9d5","user":{"login":"vermartian","id":14897176,"avatar_url":"https://avatars.githubusercontent.com/u/14897176?v=3","gravatar_id":"","url":"https://api.github.com/users/vermartian","html_url":"https://github.com/vermartian","followers_url":"https://api.github.com/users/vermartian/followers","following_url":"https://api.github.com/users/vermartian/following{/other_user}","gists_url":"https://api.github.com/users/vermartian/gists{/gist_id}","starred_url":"https://api.github.com/users/vermartian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vermartian/subscriptions","organizations_url":"https://api.github.com/users/vermartian/orgs","repos_url":"https://api.github.com/users/vermartian/repos","events_url":"https://api.github.com/users/vermartian/events{/privacy}","received_events_url":"https://api.github.com/users/vermartian/received_events","type":"User","site_admin":false},"repo":{"id":49545796,"name":"toy-chess","full_name":"vermartian/toy-chess","owner":{"login":"vermartian","id":14897176,"avatar_url":"https://avatars.githubusercontent.com/u/14897176?v=3","gravatar_id":"","url":"https://api.github.com/users/vermartian","html_url":"https://github.com/vermartian","followers_url":"https://api.github.com/users/vermartian/followers","following_url":"https://api.github.com/users/vermartian/following{/other_user}","gists_url":"https://api.github.com/users/vermartian/gists{/gist_id}","starred_url":"https://api.github.com/users/vermartian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vermartian/subscriptions","organizations_url":"https://api.github.com/users/vermartian/orgs","repos_url":"https://api.github.com/users/vermartian/repos","events_url":"https://api.github.com/users/vermartian/events{/privacy}","received_events_url":"https://api.github.com/users/vermartian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vermartian/toy-chess","description":"","fork":false,"url":"https://api.github.com/repos/vermartian/toy-chess","forks_url":"https://api.github.com/repos/vermartian/toy-chess/forks","keys_url":"https://api.github.com/repos/vermartian/toy-chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vermartian/toy-chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vermartian/toy-chess/teams","hooks_url":"https://api.github.com/repos/vermartian/toy-chess/hooks","issue_events_url":"https://api.github.com/repos/vermartian/toy-chess/issues/events{/number}","events_url":"https://api.github.com/repos/vermartian/toy-chess/events","assignees_url":"https://api.github.com/repos/vermartian/toy-chess/assignees{/user}","branches_url":"https://api.github.com/repos/vermartian/toy-chess/branches{/branch}","tags_url":"https://api.github.com/repos/vermartian/toy-chess/tags","blobs_url":"https://api.github.com/repos/vermartian/toy-chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vermartian/toy-chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vermartian/toy-chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/vermartian/toy-chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vermartian/toy-chess/statuses/{sha}","languages_url":"https://api.github.com/repos/vermartian/toy-chess/languages","stargazers_url":"https://api.github.com/repos/vermartian/toy-chess/stargazers","contributors_url":"https://api.github.com/repos/vermartian/toy-chess/contributors","subscribers_url":"https://api.github.com/repos/vermartian/toy-chess/subscribers","subscription_url":"https://api.github.com/repos/vermartian/toy-chess/subscription","commits_url":"https://api.github.com/repos/vermartian/toy-chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/vermartian/toy-chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/vermartian/toy-chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/vermartian/toy-chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/vermartian/toy-chess/contents/{+path}","compare_url":"https://api.github.com/repos/vermartian/toy-chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vermartian/toy-chess/merges","archive_url":"https://api.github.com/repos/vermartian/toy-chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vermartian/toy-chess/downloads","issues_url":"https://api.github.com/repos/vermartian/toy-chess/issues{/number}","pulls_url":"https://api.github.com/repos/vermartian/toy-chess/pulls{/number}","milestones_url":"https://api.github.com/repos/vermartian/toy-chess/milestones{/number}","notifications_url":"https://api.github.com/repos/vermartian/toy-chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vermartian/toy-chess/labels{/name}","releases_url":"https://api.github.com/repos/vermartian/toy-chess/releases{/id}","deployments_url":"https://api.github.com/repos/vermartian/toy-chess/deployments","created_at":"2016-01-13T03:08:40Z","updated_at":"2016-01-13T03:12:19Z","pushed_at":"2016-02-10T07:48:43Z","git_url":"git://github.com/vermartian/toy-chess.git","ssh_url":"git@github.com:vermartian/toy-chess.git","clone_url":"https://github.com/vermartian/toy-chess.git","svn_url":"https://github.com/vermartian/toy-chess","homepage":null,"size":1161,"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":"vermartian:master","ref":"master","sha":"a55868dc69897f635747371a0f394a452ce8a86d","user":{"login":"vermartian","id":14897176,"avatar_url":"https://avatars.githubusercontent.com/u/14897176?v=3","gravatar_id":"","url":"https://api.github.com/users/vermartian","html_url":"https://github.com/vermartian","followers_url":"https://api.github.com/users/vermartian/followers","following_url":"https://api.github.com/users/vermartian/following{/other_user}","gists_url":"https://api.github.com/users/vermartian/gists{/gist_id}","starred_url":"https://api.github.com/users/vermartian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vermartian/subscriptions","organizations_url":"https://api.github.com/users/vermartian/orgs","repos_url":"https://api.github.com/users/vermartian/repos","events_url":"https://api.github.com/users/vermartian/events{/privacy}","received_events_url":"https://api.github.com/users/vermartian/received_events","type":"User","site_admin":false},"repo":{"id":49545796,"name":"toy-chess","full_name":"vermartian/toy-chess","owner":{"login":"vermartian","id":14897176,"avatar_url":"https://avatars.githubusercontent.com/u/14897176?v=3","gravatar_id":"","url":"https://api.github.com/users/vermartian","html_url":"https://github.com/vermartian","followers_url":"https://api.github.com/users/vermartian/followers","following_url":"https://api.github.com/users/vermartian/following{/other_user}","gists_url":"https://api.github.com/users/vermartian/gists{/gist_id}","starred_url":"https://api.github.com/users/vermartian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vermartian/subscriptions","organizations_url":"https://api.github.com/users/vermartian/orgs","repos_url":"https://api.github.com/users/vermartian/repos","events_url":"https://api.github.com/users/vermartian/events{/privacy}","received_events_url":"https://api.github.com/users/vermartian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vermartian/toy-chess","description":"","fork":false,"url":"https://api.github.com/repos/vermartian/toy-chess","forks_url":"https://api.github.com/repos/vermartian/toy-chess/forks","keys_url":"https://api.github.com/repos/vermartian/toy-chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vermartian/toy-chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vermartian/toy-chess/teams","hooks_url":"https://api.github.com/repos/vermartian/toy-chess/hooks","issue_events_url":"https://api.github.com/repos/vermartian/toy-chess/issues/events{/number}","events_url":"https://api.github.com/repos/vermartian/toy-chess/events","assignees_url":"https://api.github.com/repos/vermartian/toy-chess/assignees{/user}","branches_url":"https://api.github.com/repos/vermartian/toy-chess/branches{/branch}","tags_url":"https://api.github.com/repos/vermartian/toy-chess/tags","blobs_url":"https://api.github.com/repos/vermartian/toy-chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vermartian/toy-chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vermartian/toy-chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/vermartian/toy-chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vermartian/toy-chess/statuses/{sha}","languages_url":"https://api.github.com/repos/vermartian/toy-chess/languages","stargazers_url":"https://api.github.com/repos/vermartian/toy-chess/stargazers","contributors_url":"https://api.github.com/repos/vermartian/toy-chess/contributors","subscribers_url":"https://api.github.com/repos/vermartian/toy-chess/subscribers","subscription_url":"https://api.github.com/repos/vermartian/toy-chess/subscription","commits_url":"https://api.github.com/repos/vermartian/toy-chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/vermartian/toy-chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/vermartian/toy-chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/vermartian/toy-chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/vermartian/toy-chess/contents/{+path}","compare_url":"https://api.github.com/repos/vermartian/toy-chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vermartian/toy-chess/merges","archive_url":"https://api.github.com/repos/vermartian/toy-chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vermartian/toy-chess/downloads","issues_url":"https://api.github.com/repos/vermartian/toy-chess/issues{/number}","pulls_url":"https://api.github.com/repos/vermartian/toy-chess/pulls{/number}","milestones_url":"https://api.github.com/repos/vermartian/toy-chess/milestones{/number}","notifications_url":"https://api.github.com/repos/vermartian/toy-chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vermartian/toy-chess/labels{/name}","releases_url":"https://api.github.com/repos/vermartian/toy-chess/releases{/id}","deployments_url":"https://api.github.com/repos/vermartian/toy-chess/deployments","created_at":"2016-01-13T03:08:40Z","updated_at":"2016-01-13T03:12:19Z","pushed_at":"2016-02-10T07:48:43Z","git_url":"git://github.com/vermartian/toy-chess.git","ssh_url":"git@github.com:vermartian/toy-chess.git","clone_url":"https://github.com/vermartian/toy-chess.git","svn_url":"https://github.com/vermartian/toy-chess","homepage":null,"size":1161,"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/vermartian/toy-chess/pulls/20"},"html":{"href":"https://github.com/vermartian/toy-chess/pull/20"},"issue":{"href":"https://api.github.com/repos/vermartian/toy-chess/issues/20"},"comments":{"href":"https://api.github.com/repos/vermartian/toy-chess/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/vermartian/toy-chess/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/vermartian/toy-chess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vermartian/toy-chess/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/vermartian/toy-chess/statuses/10de9c57c2d8f931dcd4c0d367c84dfba1f1f9d5"}}}}