{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments/75602473","id":75602473,"diff_hunk":"@@ -1,184 +1,232 @@\n # keep only the elements that start with an a\n def select_elements_starting_with_a(array)\n+  array.select { |fruit| fruit[0] == 'a' }\n end\n \n # keep only the elements that start with a vowel\n def select_elements_starting_with_vowel(array)\n+  array.select { |name| name[0] =~ /[aeiou]/}\n end\n \n # remove instances of nil (but NOT false) from an array\n def remove_nils_from_array(array)\n+  array.compact\n end\n \n # remove instances of nil AND false from an array\n def remove_nils_and_false_from_array(array)\n+  array.select { |element| element =~ /[A-z]/}\n end\n \n # don't reverse the array, but reverse every word inside it. e.g.\n # ['dog', 'monkey'] becomes ['god', 'yeknom']\n def reverse_every_element_in_array(array)\n+  array.map{ |element| element.reverse }\n end\n \n # given an array of student names, like ['Bob', 'Dave', 'Clive']\n # give every possible pairing - in this case:\n # [['Bob', 'Clive'], ['Bob', 'Dave'], ['Clive', 'Dave']]\n-# make sure you don't have the same pairing twice, \n+# make sure you don't have the same pairing twice,\n def every_possible_pairing_of_students(array)\n+  array.combination(2).to_a\n end\n \n-# discard the first 3 elements of an array, \n+# discard the first 3 elements of an array,\n # e.g. [1, 2, 3, 4, 5, 6] becomes [4, 5, 6]\n def all_elements_except_first_3(array)\n+  array.drop(3)\n end\n \n # add an element to the beginning of an array\n def add_element_to_beginning_of_array(array, element)\n+  array.insert(0,element)\n end\n \n # sort an array of words by their last letter, e.g.\n # ['sky', 'puma', 'maker'] becomes ['puma', 'maker', 'sky']\n def array_sort_by_last_letter_of_word(array)\n+  array.sort_by{ |letter| letter[-1] }\n end\n \n # cut strings in half, and return the first half, e.g.\n # 'banana' becomes 'ban'. If the string is an odd number of letters\n # round up - so 'apple' becomes 'app'\n def get_first_half_of_string(string)\n+  half = (string.length/2.to_f).ceil\n+  string.slice(0,half)\n end\n \n # turn a positive integer into a negative integer. A negative integer\n # stays negative\n def make_numbers_negative(number)\n+  return -number if number > 0\n+  number\n end\n \n-# turn an array of numbers into two arrays of numbers, one an array of \n+# turn an array of numbers into two arrays of numbers, one an array of\n # even numbers, the other an array of odd numbers\n # even numbers come first\n # so [1, 2, 3, 4, 5, 6] becomes [[2, 4, 6], [1, 3, 5]]\n def separate_array_into_even_and_odd_numbers(array)\n+  array.partition { |number| number.even?  }\n end\n \n # count the numbers of elements in an element which are palindromes\n # a palindrome is a word that's the same backwards as forward\n # e.g. 'bob'. So in the array ['bob', 'radar', 'eat'], there\n # are 2 palindromes (bob and radar), so the method should return 2\n def number_of_elements_that_are_palindromes(array)\n+  array.count { |element| element == element.reverse}","path":"lib/questions.rb","position":83,"original_position":83,"commit_id":"eddfacc72c1a358a16405edbf7f3913881a4dd6f","original_commit_id":"eddfacc72c1a358a16405edbf7f3913881a4dd6f","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Space missing inside }.","created_at":"2016-08-21T20:11:55Z","updated_at":"2016-08-21T20:11:55Z","html_url":"https://github.com/makersacademy/ruby-refresher/pull/56#discussion_r75602473","pull_request_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments/75602473"},"html":{"href":"https://github.com/makersacademy/ruby-refresher/pull/56#discussion_r75602473"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56","id":82115535,"html_url":"https://github.com/makersacademy/ruby-refresher/pull/56","diff_url":"https://github.com/makersacademy/ruby-refresher/pull/56.diff","patch_url":"https://github.com/makersacademy/ruby-refresher/pull/56.patch","issue_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/56","number":56,"state":"open","locked":false,"title":"Ruby refresher","user":{"login":"mzishtiaq","id":4838801,"avatar_url":"https://avatars.githubusercontent.com/u/4838801?v=3","gravatar_id":"","url":"https://api.github.com/users/mzishtiaq","html_url":"https://github.com/mzishtiaq","followers_url":"https://api.github.com/users/mzishtiaq/followers","following_url":"https://api.github.com/users/mzishtiaq/following{/other_user}","gists_url":"https://api.github.com/users/mzishtiaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mzishtiaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzishtiaq/subscriptions","organizations_url":"https://api.github.com/users/mzishtiaq/orgs","repos_url":"https://api.github.com/users/mzishtiaq/repos","events_url":"https://api.github.com/users/mzishtiaq/events{/privacy}","received_events_url":"https://api.github.com/users/mzishtiaq/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-21T20:11:52Z","updated_at":"2016-08-21T20:11:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79be6fa7bb0691a00b896fc0c7210b2040c1897d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56/commits","review_comments_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56/comments","review_comment_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/56/comments","statuses_url":"https://api.github.com/repos/makersacademy/ruby-refresher/statuses/eddfacc72c1a358a16405edbf7f3913881a4dd6f","head":{"label":"mzishtiaq:master","ref":"master","sha":"eddfacc72c1a358a16405edbf7f3913881a4dd6f","user":{"login":"mzishtiaq","id":4838801,"avatar_url":"https://avatars.githubusercontent.com/u/4838801?v=3","gravatar_id":"","url":"https://api.github.com/users/mzishtiaq","html_url":"https://github.com/mzishtiaq","followers_url":"https://api.github.com/users/mzishtiaq/followers","following_url":"https://api.github.com/users/mzishtiaq/following{/other_user}","gists_url":"https://api.github.com/users/mzishtiaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mzishtiaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzishtiaq/subscriptions","organizations_url":"https://api.github.com/users/mzishtiaq/orgs","repos_url":"https://api.github.com/users/mzishtiaq/repos","events_url":"https://api.github.com/users/mzishtiaq/events{/privacy}","received_events_url":"https://api.github.com/users/mzishtiaq/received_events","type":"User","site_admin":false},"repo":{"id":66094145,"name":"ruby-refresher","full_name":"mzishtiaq/ruby-refresher","owner":{"login":"mzishtiaq","id":4838801,"avatar_url":"https://avatars.githubusercontent.com/u/4838801?v=3","gravatar_id":"","url":"https://api.github.com/users/mzishtiaq","html_url":"https://github.com/mzishtiaq","followers_url":"https://api.github.com/users/mzishtiaq/followers","following_url":"https://api.github.com/users/mzishtiaq/following{/other_user}","gists_url":"https://api.github.com/users/mzishtiaq/gists{/gist_id}","starred_url":"https://api.github.com/users/mzishtiaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzishtiaq/subscriptions","organizations_url":"https://api.github.com/users/mzishtiaq/orgs","repos_url":"https://api.github.com/users/mzishtiaq/repos","events_url":"https://api.github.com/users/mzishtiaq/events{/privacy}","received_events_url":"https://api.github.com/users/mzishtiaq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzishtiaq/ruby-refresher","description":"Let's revisit the basics of Ruby.","fork":true,"url":"https://api.github.com/repos/mzishtiaq/ruby-refresher","forks_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/forks","keys_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/teams","hooks_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/hooks","issue_events_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/issues/events{/number}","events_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/events","assignees_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/assignees{/user}","branches_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/branches{/branch}","tags_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/tags","blobs_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/statuses/{sha}","languages_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/languages","stargazers_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/stargazers","contributors_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/contributors","subscribers_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/subscribers","subscription_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/subscription","commits_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/issues/comments{/number}","contents_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/contents/{+path}","compare_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/merges","archive_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/downloads","issues_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/issues{/number}","pulls_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/pulls{/number}","milestones_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/milestones{/number}","notifications_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/labels{/name}","releases_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/releases{/id}","deployments_url":"https://api.github.com/repos/mzishtiaq/ruby-refresher/deployments","created_at":"2016-08-19T15:54:10Z","updated_at":"2016-08-19T15:54:12Z","pushed_at":"2016-08-21T20:09:07Z","git_url":"git://github.com/mzishtiaq/ruby-refresher.git","ssh_url":"git@github.com:mzishtiaq/ruby-refresher.git","clone_url":"https://github.com/mzishtiaq/ruby-refresher.git","svn_url":"https://github.com/mzishtiaq/ruby-refresher","homepage":"","size":164,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"makersacademy:master","ref":"master","sha":"e4cf2465428d563fdff1426b449b579ad5ad3e80","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":17280753,"name":"ruby-refresher","full_name":"makersacademy/ruby-refresher","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/ruby-refresher","description":"Let's revisit the basics of Ruby.","fork":true,"url":"https://api.github.com/repos/makersacademy/ruby-refresher","forks_url":"https://api.github.com/repos/makersacademy/ruby-refresher/forks","keys_url":"https://api.github.com/repos/makersacademy/ruby-refresher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/ruby-refresher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/ruby-refresher/teams","hooks_url":"https://api.github.com/repos/makersacademy/ruby-refresher/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/ruby-refresher/events","assignees_url":"https://api.github.com/repos/makersacademy/ruby-refresher/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/ruby-refresher/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/ruby-refresher/tags","blobs_url":"https://api.github.com/repos/makersacademy/ruby-refresher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/ruby-refresher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/ruby-refresher/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/ruby-refresher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/ruby-refresher/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/ruby-refresher/languages","stargazers_url":"https://api.github.com/repos/makersacademy/ruby-refresher/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/ruby-refresher/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/ruby-refresher/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/ruby-refresher/subscription","commits_url":"https://api.github.com/repos/makersacademy/ruby-refresher/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/ruby-refresher/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/ruby-refresher/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/ruby-refresher/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/ruby-refresher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/ruby-refresher/merges","archive_url":"https://api.github.com/repos/makersacademy/ruby-refresher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/ruby-refresher/downloads","issues_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/ruby-refresher/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/ruby-refresher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/ruby-refresher/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/ruby-refresher/releases{/id}","deployments_url":"https://api.github.com/repos/makersacademy/ruby-refresher/deployments","created_at":"2014-02-28T08:59:34Z","updated_at":"2016-05-11T10:01:27Z","pushed_at":"2016-08-21T20:11:52Z","git_url":"git://github.com/makersacademy/ruby-refresher.git","ssh_url":"git@github.com:makersacademy/ruby-refresher.git","clone_url":"https://github.com/makersacademy/ruby-refresher.git","svn_url":"https://github.com/makersacademy/ruby-refresher","homepage":"","size":177,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":31,"forks":141,"open_issues":31,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56"},"html":{"href":"https://github.com/makersacademy/ruby-refresher/pull/56"},"issue":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/56"},"comments":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/statuses/eddfacc72c1a358a16405edbf7f3913881a4dd6f"}}}}
{"actor":{"display_login":"houndci-bot"}}