{"action":"created","comment":{"url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/comments/39938445","id":39938445,"diff_hunk":"@@ -18,4 +19,18 @@ def add_entry(name, phone, email)\n \n     @entries.insert(index, Entry.new(name, phone, email))\n   end\n+\n+  def remove_entry(name, phone, email)\n+    # using index where I could have set a delete_entry variable\n+    index = 0\n+\n+    @entries.each do |entry|\n+      if name == entry.name && phone = entry.phone_number && email == entry.email\n+        break\n+      end\n+      index += 1\n+    end\n+    # could have said @entries.delete(delete_entry)","path":"models/address_book.rb","position":23,"original_position":23,"commit_id":"5284ddb42840e4820b0aafcd68199d550d0f9b43","original_commit_id":"5284ddb42840e4820b0aafcd68199d550d0f9b43","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":"You can still change this and remove the `index` variable :+1: See if you can get it working with just the `each` block and `entry` :smile: ","created_at":"2015-09-21T01:58:19Z","updated_at":"2015-09-21T01:58:19Z","html_url":"https://github.com/npauzenga/address-bloc/pull/1#discussion_r39938445","pull_request_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/comments/39938445"},"html":{"href":"https://github.com/npauzenga/address-bloc/pull/1#discussion_r39938445"},"pull_request":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1","id":45502712,"html_url":"https://github.com/npauzenga/address-bloc/pull/1","diff_url":"https://github.com/npauzenga/address-bloc/pull/1.diff","patch_url":"https://github.com/npauzenga/address-bloc/pull/1.patch","issue_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/1","number":1,"state":"open","locked":false,"title":"Assignment 21 completed","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"body":"So I watched the tutorial video and subsequently made some changes. If you check out _spec/address_book_spec.rb_, you'll see lines 43 - 46 commented out. 44 - 46 represent my initial attempt at the test. I was thinking that I could rely on the previous test in the `AddressBook#add_entry` context to add an entry, which I could then remove in the `AddressBook#remove_entry` test. \r\n\r\nIn hindsight this was not a great idea. Not only would it make one test depend on another, it actually doesn't work. The test passed because I was checking to see that the size was == 0 (thinking it was because an entry was removed). Turns out, because I created a new instance of AddressBook in this test there was no previous entry and the size started out at 0. Line 43 is me figuring this out :-)\r\n\r\nAlso, in the actual `AddressBook#remove_entry` method, you'll see I used an index like `add_entry`. Using the `delete_entry` variable might be a little cleaner.","created_at":"2015-09-20T19:50:41Z","updated_at":"2015-09-21T01:58:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a60ef4d8007626852b4d6b3668685fc8f14c814","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1/commits","review_comments_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1/comments","review_comment_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/1/comments","statuses_url":"https://api.github.com/repos/npauzenga/address-bloc/statuses/5284ddb42840e4820b0aafcd68199d550d0f9b43","head":{"label":"npauzenga:assignment-21-RubyModels","ref":"assignment-21-RubyModels","sha":"5284ddb42840e4820b0aafcd68199d550d0f9b43","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"repo":{"id":42790147,"name":"address-bloc","full_name":"npauzenga/address-bloc","owner":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npauzenga/address-bloc","description":"","fork":false,"url":"https://api.github.com/repos/npauzenga/address-bloc","forks_url":"https://api.github.com/repos/npauzenga/address-bloc/forks","keys_url":"https://api.github.com/repos/npauzenga/address-bloc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npauzenga/address-bloc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npauzenga/address-bloc/teams","hooks_url":"https://api.github.com/repos/npauzenga/address-bloc/hooks","issue_events_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/events{/number}","events_url":"https://api.github.com/repos/npauzenga/address-bloc/events","assignees_url":"https://api.github.com/repos/npauzenga/address-bloc/assignees{/user}","branches_url":"https://api.github.com/repos/npauzenga/address-bloc/branches{/branch}","tags_url":"https://api.github.com/repos/npauzenga/address-bloc/tags","blobs_url":"https://api.github.com/repos/npauzenga/address-bloc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npauzenga/address-bloc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npauzenga/address-bloc/git/refs{/sha}","trees_url":"https://api.github.com/repos/npauzenga/address-bloc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npauzenga/address-bloc/statuses/{sha}","languages_url":"https://api.github.com/repos/npauzenga/address-bloc/languages","stargazers_url":"https://api.github.com/repos/npauzenga/address-bloc/stargazers","contributors_url":"https://api.github.com/repos/npauzenga/address-bloc/contributors","subscribers_url":"https://api.github.com/repos/npauzenga/address-bloc/subscribers","subscription_url":"https://api.github.com/repos/npauzenga/address-bloc/subscription","commits_url":"https://api.github.com/repos/npauzenga/address-bloc/commits{/sha}","git_commits_url":"https://api.github.com/repos/npauzenga/address-bloc/git/commits{/sha}","comments_url":"https://api.github.com/repos/npauzenga/address-bloc/comments{/number}","issue_comment_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/comments{/number}","contents_url":"https://api.github.com/repos/npauzenga/address-bloc/contents/{+path}","compare_url":"https://api.github.com/repos/npauzenga/address-bloc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npauzenga/address-bloc/merges","archive_url":"https://api.github.com/repos/npauzenga/address-bloc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npauzenga/address-bloc/downloads","issues_url":"https://api.github.com/repos/npauzenga/address-bloc/issues{/number}","pulls_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls{/number}","milestones_url":"https://api.github.com/repos/npauzenga/address-bloc/milestones{/number}","notifications_url":"https://api.github.com/repos/npauzenga/address-bloc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npauzenga/address-bloc/labels{/name}","releases_url":"https://api.github.com/repos/npauzenga/address-bloc/releases{/id}","created_at":"2015-09-19T21:24:48Z","updated_at":"2015-09-19T21:33:54Z","pushed_at":"2015-09-20T22:20:34Z","git_url":"git://github.com/npauzenga/address-bloc.git","ssh_url":"git@github.com:npauzenga/address-bloc.git","clone_url":"https://github.com/npauzenga/address-bloc.git","svn_url":"https://github.com/npauzenga/address-bloc","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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"npauzenga:master","ref":"master","sha":"1427da99201723d6c95acc4980d4df2464d77bea","user":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"repo":{"id":42790147,"name":"address-bloc","full_name":"npauzenga/address-bloc","owner":{"login":"npauzenga","id":5838826,"avatar_url":"https://avatars.githubusercontent.com/u/5838826?v=3","gravatar_id":"","url":"https://api.github.com/users/npauzenga","html_url":"https://github.com/npauzenga","followers_url":"https://api.github.com/users/npauzenga/followers","following_url":"https://api.github.com/users/npauzenga/following{/other_user}","gists_url":"https://api.github.com/users/npauzenga/gists{/gist_id}","starred_url":"https://api.github.com/users/npauzenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npauzenga/subscriptions","organizations_url":"https://api.github.com/users/npauzenga/orgs","repos_url":"https://api.github.com/users/npauzenga/repos","events_url":"https://api.github.com/users/npauzenga/events{/privacy}","received_events_url":"https://api.github.com/users/npauzenga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npauzenga/address-bloc","description":"","fork":false,"url":"https://api.github.com/repos/npauzenga/address-bloc","forks_url":"https://api.github.com/repos/npauzenga/address-bloc/forks","keys_url":"https://api.github.com/repos/npauzenga/address-bloc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npauzenga/address-bloc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npauzenga/address-bloc/teams","hooks_url":"https://api.github.com/repos/npauzenga/address-bloc/hooks","issue_events_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/events{/number}","events_url":"https://api.github.com/repos/npauzenga/address-bloc/events","assignees_url":"https://api.github.com/repos/npauzenga/address-bloc/assignees{/user}","branches_url":"https://api.github.com/repos/npauzenga/address-bloc/branches{/branch}","tags_url":"https://api.github.com/repos/npauzenga/address-bloc/tags","blobs_url":"https://api.github.com/repos/npauzenga/address-bloc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npauzenga/address-bloc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npauzenga/address-bloc/git/refs{/sha}","trees_url":"https://api.github.com/repos/npauzenga/address-bloc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npauzenga/address-bloc/statuses/{sha}","languages_url":"https://api.github.com/repos/npauzenga/address-bloc/languages","stargazers_url":"https://api.github.com/repos/npauzenga/address-bloc/stargazers","contributors_url":"https://api.github.com/repos/npauzenga/address-bloc/contributors","subscribers_url":"https://api.github.com/repos/npauzenga/address-bloc/subscribers","subscription_url":"https://api.github.com/repos/npauzenga/address-bloc/subscription","commits_url":"https://api.github.com/repos/npauzenga/address-bloc/commits{/sha}","git_commits_url":"https://api.github.com/repos/npauzenga/address-bloc/git/commits{/sha}","comments_url":"https://api.github.com/repos/npauzenga/address-bloc/comments{/number}","issue_comment_url":"https://api.github.com/repos/npauzenga/address-bloc/issues/comments{/number}","contents_url":"https://api.github.com/repos/npauzenga/address-bloc/contents/{+path}","compare_url":"https://api.github.com/repos/npauzenga/address-bloc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npauzenga/address-bloc/merges","archive_url":"https://api.github.com/repos/npauzenga/address-bloc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npauzenga/address-bloc/downloads","issues_url":"https://api.github.com/repos/npauzenga/address-bloc/issues{/number}","pulls_url":"https://api.github.com/repos/npauzenga/address-bloc/pulls{/number}","milestones_url":"https://api.github.com/repos/npauzenga/address-bloc/milestones{/number}","notifications_url":"https://api.github.com/repos/npauzenga/address-bloc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npauzenga/address-bloc/labels{/name}","releases_url":"https://api.github.com/repos/npauzenga/address-bloc/releases{/id}","created_at":"2015-09-19T21:24:48Z","updated_at":"2015-09-19T21:33:54Z","pushed_at":"2015-09-20T22:20:34Z","git_url":"git://github.com/npauzenga/address-bloc.git","ssh_url":"git@github.com:npauzenga/address-bloc.git","clone_url":"https://github.com/npauzenga/address-bloc.git","svn_url":"https://github.com/npauzenga/address-bloc","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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1"},"html":{"href":"https://github.com/npauzenga/address-bloc/pull/1"},"issue":{"href":"https://api.github.com/repos/npauzenga/address-bloc/issues/1"},"comments":{"href":"https://api.github.com/repos/npauzenga/address-bloc/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npauzenga/address-bloc/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/npauzenga/address-bloc/statuses/5284ddb42840e4820b0aafcd68199d550d0f9b43"}}}}