{"action":"created","comment":{"url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/comments/46229374","id":46229374,"diff_hunk":"@@ -1,2 +1,30 @@\n class Pawn < Piece\n+  # rubocop:disable Metrics/LineLength \n+  def valid_move?(row_dest, col_dest)\n+  \trow_diff = (row_position - row_dest).abs\n+    col_diff = (col_position - col_dest).abs\n+  \tcase \n+  \twhen self.backward_move?(row_dest, col_dest) then false\n+  \twhen !self.obstructed?(row_dest, col_dest) && self.diagonal_move?(row_dest, col_dest) &&  col_diff == 1 && row_diff == 1 && game.pieces.find_by(row_position: row_dest, col_position: col_dest) && !self.own_piece?(row_dest, col_dest) then true\n+    when !self.obstructed?(row_dest, col_dest) && self.vertical_move?(row_dest, col_dest) && !game.pieces.find_by(row_position: row_dest, col_position: col_dest) then\n+  \t  if row_position == 1 || row_position == 6 \n+  \t    if row_diff <= 2\n+  \t    \treturn true\n+  \t    elsif row_diff == 1\n+  \t    \treturn true\n+  \t    else\n+  \t    \treturn false\n+  \t    end\t \n+  \t  end \n+  \t  else\n+  \t  return false \t\t\n+  \tend\n+  end\n+\n+  def backward_move?(row_dest, col_dest)\n+  \t@piece = Piece.find_by(row_position: row_dest, col_position: col_dest)\n+  \t@peace && @piece.user_id == @piece.game.white_player_id ? row_dest < row_position : row_dest > row_position","path":"app/models/pieces/pawn.rb","position":26,"original_position":26,"commit_id":"09a54c7d450b19ab0fbb7409888a75fcab1757ac","original_commit_id":"09a54c7d450b19ab0fbb7409888a75fcab1757ac","user":{"login":"gagaception","id":13584120,"avatar_url":"https://avatars.githubusercontent.com/u/13584120?v=3","gravatar_id":"","url":"https://api.github.com/users/gagaception","html_url":"https://github.com/gagaception","followers_url":"https://api.github.com/users/gagaception/followers","following_url":"https://api.github.com/users/gagaception/following{/other_user}","gists_url":"https://api.github.com/users/gagaception/gists{/gist_id}","starred_url":"https://api.github.com/users/gagaception/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagaception/subscriptions","organizations_url":"https://api.github.com/users/gagaception/orgs","repos_url":"https://api.github.com/users/gagaception/repos","events_url":"https://api.github.com/users/gagaception/events{/privacy}","received_events_url":"https://api.github.com/users/gagaception/received_events","type":"User","site_admin":false},"body":"@takehiromouri what a stupid mistake :laughing:  ","created_at":"2015-12-01T01:18:54Z","updated_at":"2015-12-01T01:18:54Z","html_url":"https://github.com/teamendgame/endgame-chess/pull/36#discussion_r46229374","pull_request_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/comments/46229374"},"html":{"href":"https://github.com/teamendgame/endgame-chess/pull/36#discussion_r46229374"},"pull_request":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36","id":52153031,"html_url":"https://github.com/teamendgame/endgame-chess/pull/36","diff_url":"https://github.com/teamendgame/endgame-chess/pull/36.diff","patch_url":"https://github.com/teamendgame/endgame-chess/pull/36.patch","issue_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/36","number":36,"state":"open","locked":false,"title":"Pawn valid_move? ","user":{"login":"gagaception","id":13584120,"avatar_url":"https://avatars.githubusercontent.com/u/13584120?v=3","gravatar_id":"","url":"https://api.github.com/users/gagaception","html_url":"https://github.com/gagaception","followers_url":"https://api.github.com/users/gagaception/followers","following_url":"https://api.github.com/users/gagaception/following{/other_user}","gists_url":"https://api.github.com/users/gagaception/gists{/gist_id}","starred_url":"https://api.github.com/users/gagaception/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagaception/subscriptions","organizations_url":"https://api.github.com/users/gagaception/orgs","repos_url":"https://api.github.com/users/gagaception/repos","events_url":"https://api.github.com/users/gagaception/events{/privacy}","received_events_url":"https://api.github.com/users/gagaception/received_events","type":"User","site_admin":false},"body":"## :warning: Work in progress :warning: \r\n- [ ] check if backward_move? method works correctly \r\n- [ ] make all tests to pass\r\n- [ ] refactor conditions from line 10 to 17 using moved? method (after Castling PR will be merged)\r\n ","created_at":"2015-11-30T17:21:53Z","updated_at":"2015-12-01T01:18:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dcf802682572c8fb588ecf2e19b8e05f5a977eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36/commits","review_comments_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36/comments","review_comment_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/36/comments","statuses_url":"https://api.github.com/repos/teamendgame/endgame-chess/statuses/09a54c7d450b19ab0fbb7409888a75fcab1757ac","head":{"label":"teamendgame:pawn-valid-move","ref":"pawn-valid-move","sha":"09a54c7d450b19ab0fbb7409888a75fcab1757ac","user":{"login":"teamendgame","id":15490891,"avatar_url":"https://avatars.githubusercontent.com/u/15490891?v=3","gravatar_id":"","url":"https://api.github.com/users/teamendgame","html_url":"https://github.com/teamendgame","followers_url":"https://api.github.com/users/teamendgame/followers","following_url":"https://api.github.com/users/teamendgame/following{/other_user}","gists_url":"https://api.github.com/users/teamendgame/gists{/gist_id}","starred_url":"https://api.github.com/users/teamendgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamendgame/subscriptions","organizations_url":"https://api.github.com/users/teamendgame/orgs","repos_url":"https://api.github.com/users/teamendgame/repos","events_url":"https://api.github.com/users/teamendgame/events{/privacy}","received_events_url":"https://api.github.com/users/teamendgame/received_events","type":"Organization","site_admin":false},"repo":{"id":45283424,"name":"endgame-chess","full_name":"teamendgame/endgame-chess","owner":{"login":"teamendgame","id":15490891,"avatar_url":"https://avatars.githubusercontent.com/u/15490891?v=3","gravatar_id":"","url":"https://api.github.com/users/teamendgame","html_url":"https://github.com/teamendgame","followers_url":"https://api.github.com/users/teamendgame/followers","following_url":"https://api.github.com/users/teamendgame/following{/other_user}","gists_url":"https://api.github.com/users/teamendgame/gists{/gist_id}","starred_url":"https://api.github.com/users/teamendgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamendgame/subscriptions","organizations_url":"https://api.github.com/users/teamendgame/orgs","repos_url":"https://api.github.com/users/teamendgame/repos","events_url":"https://api.github.com/users/teamendgame/events{/privacy}","received_events_url":"https://api.github.com/users/teamendgame/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamendgame/endgame-chess","description":"","fork":false,"url":"https://api.github.com/repos/teamendgame/endgame-chess","forks_url":"https://api.github.com/repos/teamendgame/endgame-chess/forks","keys_url":"https://api.github.com/repos/teamendgame/endgame-chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamendgame/endgame-chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamendgame/endgame-chess/teams","hooks_url":"https://api.github.com/repos/teamendgame/endgame-chess/hooks","issue_events_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/events{/number}","events_url":"https://api.github.com/repos/teamendgame/endgame-chess/events","assignees_url":"https://api.github.com/repos/teamendgame/endgame-chess/assignees{/user}","branches_url":"https://api.github.com/repos/teamendgame/endgame-chess/branches{/branch}","tags_url":"https://api.github.com/repos/teamendgame/endgame-chess/tags","blobs_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamendgame/endgame-chess/statuses/{sha}","languages_url":"https://api.github.com/repos/teamendgame/endgame-chess/languages","stargazers_url":"https://api.github.com/repos/teamendgame/endgame-chess/stargazers","contributors_url":"https://api.github.com/repos/teamendgame/endgame-chess/contributors","subscribers_url":"https://api.github.com/repos/teamendgame/endgame-chess/subscribers","subscription_url":"https://api.github.com/repos/teamendgame/endgame-chess/subscription","commits_url":"https://api.github.com/repos/teamendgame/endgame-chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamendgame/endgame-chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamendgame/endgame-chess/contents/{+path}","compare_url":"https://api.github.com/repos/teamendgame/endgame-chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamendgame/endgame-chess/merges","archive_url":"https://api.github.com/repos/teamendgame/endgame-chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamendgame/endgame-chess/downloads","issues_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues{/number}","pulls_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls{/number}","milestones_url":"https://api.github.com/repos/teamendgame/endgame-chess/milestones{/number}","notifications_url":"https://api.github.com/repos/teamendgame/endgame-chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamendgame/endgame-chess/labels{/name}","releases_url":"https://api.github.com/repos/teamendgame/endgame-chess/releases{/id}","created_at":"2015-10-31T00:45:15Z","updated_at":"2015-10-31T00:47:28Z","pushed_at":"2015-11-30T17:21:54Z","git_url":"git://github.com/teamendgame/endgame-chess.git","ssh_url":"git@github.com:teamendgame/endgame-chess.git","clone_url":"https://github.com/teamendgame/endgame-chess.git","svn_url":"https://github.com/teamendgame/endgame-chess","homepage":null,"size":153,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"teamendgame:master","ref":"master","sha":"b8dd47ab53788fe5d07fac05f01caac67f1ddcec","user":{"login":"teamendgame","id":15490891,"avatar_url":"https://avatars.githubusercontent.com/u/15490891?v=3","gravatar_id":"","url":"https://api.github.com/users/teamendgame","html_url":"https://github.com/teamendgame","followers_url":"https://api.github.com/users/teamendgame/followers","following_url":"https://api.github.com/users/teamendgame/following{/other_user}","gists_url":"https://api.github.com/users/teamendgame/gists{/gist_id}","starred_url":"https://api.github.com/users/teamendgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamendgame/subscriptions","organizations_url":"https://api.github.com/users/teamendgame/orgs","repos_url":"https://api.github.com/users/teamendgame/repos","events_url":"https://api.github.com/users/teamendgame/events{/privacy}","received_events_url":"https://api.github.com/users/teamendgame/received_events","type":"Organization","site_admin":false},"repo":{"id":45283424,"name":"endgame-chess","full_name":"teamendgame/endgame-chess","owner":{"login":"teamendgame","id":15490891,"avatar_url":"https://avatars.githubusercontent.com/u/15490891?v=3","gravatar_id":"","url":"https://api.github.com/users/teamendgame","html_url":"https://github.com/teamendgame","followers_url":"https://api.github.com/users/teamendgame/followers","following_url":"https://api.github.com/users/teamendgame/following{/other_user}","gists_url":"https://api.github.com/users/teamendgame/gists{/gist_id}","starred_url":"https://api.github.com/users/teamendgame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamendgame/subscriptions","organizations_url":"https://api.github.com/users/teamendgame/orgs","repos_url":"https://api.github.com/users/teamendgame/repos","events_url":"https://api.github.com/users/teamendgame/events{/privacy}","received_events_url":"https://api.github.com/users/teamendgame/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamendgame/endgame-chess","description":"","fork":false,"url":"https://api.github.com/repos/teamendgame/endgame-chess","forks_url":"https://api.github.com/repos/teamendgame/endgame-chess/forks","keys_url":"https://api.github.com/repos/teamendgame/endgame-chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamendgame/endgame-chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamendgame/endgame-chess/teams","hooks_url":"https://api.github.com/repos/teamendgame/endgame-chess/hooks","issue_events_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/events{/number}","events_url":"https://api.github.com/repos/teamendgame/endgame-chess/events","assignees_url":"https://api.github.com/repos/teamendgame/endgame-chess/assignees{/user}","branches_url":"https://api.github.com/repos/teamendgame/endgame-chess/branches{/branch}","tags_url":"https://api.github.com/repos/teamendgame/endgame-chess/tags","blobs_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamendgame/endgame-chess/statuses/{sha}","languages_url":"https://api.github.com/repos/teamendgame/endgame-chess/languages","stargazers_url":"https://api.github.com/repos/teamendgame/endgame-chess/stargazers","contributors_url":"https://api.github.com/repos/teamendgame/endgame-chess/contributors","subscribers_url":"https://api.github.com/repos/teamendgame/endgame-chess/subscribers","subscription_url":"https://api.github.com/repos/teamendgame/endgame-chess/subscription","commits_url":"https://api.github.com/repos/teamendgame/endgame-chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamendgame/endgame-chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamendgame/endgame-chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamendgame/endgame-chess/contents/{+path}","compare_url":"https://api.github.com/repos/teamendgame/endgame-chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamendgame/endgame-chess/merges","archive_url":"https://api.github.com/repos/teamendgame/endgame-chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamendgame/endgame-chess/downloads","issues_url":"https://api.github.com/repos/teamendgame/endgame-chess/issues{/number}","pulls_url":"https://api.github.com/repos/teamendgame/endgame-chess/pulls{/number}","milestones_url":"https://api.github.com/repos/teamendgame/endgame-chess/milestones{/number}","notifications_url":"https://api.github.com/repos/teamendgame/endgame-chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamendgame/endgame-chess/labels{/name}","releases_url":"https://api.github.com/repos/teamendgame/endgame-chess/releases{/id}","created_at":"2015-10-31T00:45:15Z","updated_at":"2015-10-31T00:47:28Z","pushed_at":"2015-11-30T17:21:54Z","git_url":"git://github.com/teamendgame/endgame-chess.git","ssh_url":"git@github.com:teamendgame/endgame-chess.git","clone_url":"https://github.com/teamendgame/endgame-chess.git","svn_url":"https://github.com/teamendgame/endgame-chess","homepage":null,"size":153,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36"},"html":{"href":"https://github.com/teamendgame/endgame-chess/pull/36"},"issue":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/issues/36"},"comments":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/teamendgame/endgame-chess/statuses/09a54c7d450b19ab0fbb7409888a75fcab1757ac"}}}}