{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments/75604290","id":75604290,"diff_hunk":"@@ -1,184 +1,269 @@\n # keep only the elements that start with an a\n def select_elements_starting_with_a(array)\n+  a_array = []\n+  array.each { |word| a_array << word if word[0] == 'a' }\n+  return a_array\n end\n \n # keep only the elements that start with a vowel\n def select_elements_starting_with_vowel(array)\n+  a_array = []\n+  array.each { |word| a_array << word if (/[aieou]/).match(word[0]) != nil }\n+  return a_array\n end\n \n # remove instances of nil (but NOT false) from an array\n def remove_nils_from_array(array)\n+  a_array = []\n+  array.each { |word| a_array << word if word != nil }\n+  return a_array\n end\n \n # remove instances of nil AND false from an array\n def remove_nils_and_false_from_array(array)\n+  a_array = []\n+  array.each { |word| a_array << word if word != nil && word != false }\n+  return a_array\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 { |word| word.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-end\n-\n-# discard the first 3 elements of an array, \n+  n = 2\n+  pairray = []\n+  array.count.times do\n+    pair = []\n+    pair << array[n]\n+    pair << array[n -= 1]\n+    pairray << pair\n+  end\n+  return pairray\n+end\n+\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+  n = 3\n+  array.reverse!\n+  until n <= 0 do\n+    n -= 1\n+    array.pop\n+  end\n+  return array.reverse!\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 {|word| word[-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+  n = (string.length.to_f/2).round\n+  string.strip[0..n - 1]\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+  number > 0 ? -number : 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+  evens = []\n+  odds = []\n+  array.each { |n| n%2 == 0 ? evens << n : odds << n }\n+  return [evens, odds]\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+  palindromes = []\n+  array.each {|word| palindromes << word if word.reverse == word}\n+  return palindromes.count\n end\n \n # return the shortest word in an array\n def shortest_word_in_array(array)\n+  array.sort_by! {|word| word.length}\n+  return array[0]\n end\n \n # return the shortest word in an array\n def longest_word_in_array(array)\n+  array.sort_by! {|word| word.length}\n+  return array.pop\n end\n \n-# add up all the numbers in an array, so [1, 3, 5, 6]\n+# add up all the numbers in an array, so\n # returns 15\n def total_of_array(array)\n+  n = 0\n+  array.each{|num| n += num}","path":"lib/questions.rb","position":131,"original_position":131,"commit_id":"a9a80b09fba52f4c345d580968ec1b819cca2c02","original_commit_id":"a9a80b09fba52f4c345d580968ec1b819cca2c02","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 to the left of {.<br>Space between { and | missing.<br>Space missing inside }.","created_at":"2016-08-21T22:02:01Z","updated_at":"2016-08-21T22:02:01Z","html_url":"https://github.com/makersacademy/ruby-refresher/pull/61#discussion_r75604290","pull_request_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/comments/75604290"},"html":{"href":"https://github.com/makersacademy/ruby-refresher/pull/61#discussion_r75604290"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61","id":82118639,"html_url":"https://github.com/makersacademy/ruby-refresher/pull/61","diff_url":"https://github.com/makersacademy/ruby-refresher/pull/61.diff","patch_url":"https://github.com/makersacademy/ruby-refresher/pull/61.patch","issue_url":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/61","number":61,"state":"open","locked":false,"title":"Finished all but last 3","user":{"login":"Frunez","id":19621102,"avatar_url":"https://avatars.githubusercontent.com/u/19621102?v=3","gravatar_id":"","url":"https://api.github.com/users/Frunez","html_url":"https://github.com/Frunez","followers_url":"https://api.github.com/users/Frunez/followers","following_url":"https://api.github.com/users/Frunez/following{/other_user}","gists_url":"https://api.github.com/users/Frunez/gists{/gist_id}","starred_url":"https://api.github.com/users/Frunez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frunez/subscriptions","organizations_url":"https://api.github.com/users/Frunez/orgs","repos_url":"https://api.github.com/users/Frunez/repos","events_url":"https://api.github.com/users/Frunez/events{/privacy}","received_events_url":"https://api.github.com/users/Frunez/received_events","type":"User","site_admin":false},"body":"Last rspec'd question kept returning the file object, and returned no errors so I couldn't test my code or find out how to make it  work ","created_at":"2016-08-21T22:01:55Z","updated_at":"2016-08-21T22:02:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f93ae1014e35540f3248253d0fd053b4b86c3e1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61/commits","review_comments_url":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61/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/61/comments","statuses_url":"https://api.github.com/repos/makersacademy/ruby-refresher/statuses/a9a80b09fba52f4c345d580968ec1b819cca2c02","head":{"label":"Frunez:master","ref":"master","sha":"a9a80b09fba52f4c345d580968ec1b819cca2c02","user":{"login":"Frunez","id":19621102,"avatar_url":"https://avatars.githubusercontent.com/u/19621102?v=3","gravatar_id":"","url":"https://api.github.com/users/Frunez","html_url":"https://github.com/Frunez","followers_url":"https://api.github.com/users/Frunez/followers","following_url":"https://api.github.com/users/Frunez/following{/other_user}","gists_url":"https://api.github.com/users/Frunez/gists{/gist_id}","starred_url":"https://api.github.com/users/Frunez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frunez/subscriptions","organizations_url":"https://api.github.com/users/Frunez/orgs","repos_url":"https://api.github.com/users/Frunez/repos","events_url":"https://api.github.com/users/Frunez/events{/privacy}","received_events_url":"https://api.github.com/users/Frunez/received_events","type":"User","site_admin":false},"repo":{"id":66158406,"name":"ruby-refresher","full_name":"Frunez/ruby-refresher","owner":{"login":"Frunez","id":19621102,"avatar_url":"https://avatars.githubusercontent.com/u/19621102?v=3","gravatar_id":"","url":"https://api.github.com/users/Frunez","html_url":"https://github.com/Frunez","followers_url":"https://api.github.com/users/Frunez/followers","following_url":"https://api.github.com/users/Frunez/following{/other_user}","gists_url":"https://api.github.com/users/Frunez/gists{/gist_id}","starred_url":"https://api.github.com/users/Frunez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frunez/subscriptions","organizations_url":"https://api.github.com/users/Frunez/orgs","repos_url":"https://api.github.com/users/Frunez/repos","events_url":"https://api.github.com/users/Frunez/events{/privacy}","received_events_url":"https://api.github.com/users/Frunez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Frunez/ruby-refresher","description":"Let's revisit the basics of Ruby.","fork":true,"url":"https://api.github.com/repos/Frunez/ruby-refresher","forks_url":"https://api.github.com/repos/Frunez/ruby-refresher/forks","keys_url":"https://api.github.com/repos/Frunez/ruby-refresher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Frunez/ruby-refresher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Frunez/ruby-refresher/teams","hooks_url":"https://api.github.com/repos/Frunez/ruby-refresher/hooks","issue_events_url":"https://api.github.com/repos/Frunez/ruby-refresher/issues/events{/number}","events_url":"https://api.github.com/repos/Frunez/ruby-refresher/events","assignees_url":"https://api.github.com/repos/Frunez/ruby-refresher/assignees{/user}","branches_url":"https://api.github.com/repos/Frunez/ruby-refresher/branches{/branch}","tags_url":"https://api.github.com/repos/Frunez/ruby-refresher/tags","blobs_url":"https://api.github.com/repos/Frunez/ruby-refresher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Frunez/ruby-refresher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Frunez/ruby-refresher/git/refs{/sha}","trees_url":"https://api.github.com/repos/Frunez/ruby-refresher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Frunez/ruby-refresher/statuses/{sha}","languages_url":"https://api.github.com/repos/Frunez/ruby-refresher/languages","stargazers_url":"https://api.github.com/repos/Frunez/ruby-refresher/stargazers","contributors_url":"https://api.github.com/repos/Frunez/ruby-refresher/contributors","subscribers_url":"https://api.github.com/repos/Frunez/ruby-refresher/subscribers","subscription_url":"https://api.github.com/repos/Frunez/ruby-refresher/subscription","commits_url":"https://api.github.com/repos/Frunez/ruby-refresher/commits{/sha}","git_commits_url":"https://api.github.com/repos/Frunez/ruby-refresher/git/commits{/sha}","comments_url":"https://api.github.com/repos/Frunez/ruby-refresher/comments{/number}","issue_comment_url":"https://api.github.com/repos/Frunez/ruby-refresher/issues/comments{/number}","contents_url":"https://api.github.com/repos/Frunez/ruby-refresher/contents/{+path}","compare_url":"https://api.github.com/repos/Frunez/ruby-refresher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Frunez/ruby-refresher/merges","archive_url":"https://api.github.com/repos/Frunez/ruby-refresher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Frunez/ruby-refresher/downloads","issues_url":"https://api.github.com/repos/Frunez/ruby-refresher/issues{/number}","pulls_url":"https://api.github.com/repos/Frunez/ruby-refresher/pulls{/number}","milestones_url":"https://api.github.com/repos/Frunez/ruby-refresher/milestones{/number}","notifications_url":"https://api.github.com/repos/Frunez/ruby-refresher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Frunez/ruby-refresher/labels{/name}","releases_url":"https://api.github.com/repos/Frunez/ruby-refresher/releases{/id}","deployments_url":"https://api.github.com/repos/Frunez/ruby-refresher/deployments","created_at":"2016-08-20T17:08:05Z","updated_at":"2016-08-20T17:08:05Z","pushed_at":"2016-08-21T21:49:51Z","git_url":"git://github.com/Frunez/ruby-refresher.git","ssh_url":"git@github.com:Frunez/ruby-refresher.git","clone_url":"https://github.com/Frunez/ruby-refresher.git","svn_url":"https://github.com/Frunez/ruby-refresher","homepage":"","size":27,"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-21T22:01:57Z","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":35,"forks":141,"open_issues":35,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61"},"html":{"href":"https://github.com/makersacademy/ruby-refresher/pull/61"},"issue":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/61"},"comments":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/pulls/61/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/61/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/ruby-refresher/statuses/a9a80b09fba52f4c345d580968ec1b819cca2c02"}}}}
{"actor":{"display_login":"houndci-bot"}}