{"action":"created","comment":{"url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/comments/25669049","id":25669049,"diff_hunk":"@@ -0,0 +1,32 @@\n+#!/usr/bin/env ruby\n+#\n+# FIZZBUZZ\n+# by Tim Heuett\n+#\n+# Prompt:\n+#   Write a method that takes one number as an argument. For multiples of three\n+#   return “Fizz”, and for the multiples of five return “Buzz”. For numbers\n+#   which are multiples of both three and five return “FizzBuzz”, and in all\n+#   other cases return the number.\n+#\n+\n+def fizzbuzz( number )\n+  output = \"\"\n+\n+  output << \"Fizz\" if number.multipleOfThree?\n+  output << \"Buzz\" if number.multipleOfFive?\n+\n+  # If there is output, return it. Otherwise, send back the original number\n+  return output.empty? ? number : output\n+end\n+\n+\n+# Adding two helper methods to Fixnum class to make this super slick\n+class Fixnum\n+  def multipleOfFive?\n+    return (not self.zero?) and (self % 5 == 0)","path":"fizzbuzz.rb","position":27,"original_position":27,"commit_id":"8c62e94c57e837bd76e7fd71616eef2c6e38e9b9","original_commit_id":"8c62e94c57e837bd76e7fd71616eef2c6e38e9b9","user":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"body":"Leaving it out of the method calls makes sense, but what is this trickery you're talking about with the mod? I can't think of any way to use an operator without having self in there. I tried calling % as a method, which works in this context:\r\n\r\n     3.% 3     # => 0\r\n\r\nBut it doesn't seem to work inside the scope of the class.\r\n\r\n    def multipleOfThree\r\n        (not zero?) and (% 3 == 0)\r\n    end\r\n\r\nResult in IRB:\r\n\r\n    fizzbuzz 3     # => 3\r\n\r\nI honestly thought it would be a syntax error, but it actually just did nothing.","created_at":"2015-03-03T08:07:23Z","updated_at":"2015-03-03T08:07:23Z","html_url":"https://github.com/TimHugh/CF-fizzbuzz/pull/2#discussion_r25669049","pull_request_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/comments/25669049"},"html":{"href":"https://github.com/TimHugh/CF-fizzbuzz/pull/2#discussion_r25669049"},"pull_request":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2","id":30335529,"html_url":"https://github.com/TimHugh/CF-fizzbuzz/pull/2","diff_url":"https://github.com/TimHugh/CF-fizzbuzz/pull/2.diff","patch_url":"https://github.com/TimHugh/CF-fizzbuzz/pull/2.patch","issue_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/2","number":2,"state":"open","locked":false,"title":"Issue#1","user":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-03T00:26:18Z","updated_at":"2015-03-03T08:07:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7da9d3cd6da79d4e7beefa12a7f0e6ee5c215d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2/commits","review_comments_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2/comments","review_comment_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/2/comments","statuses_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/statuses/8c62e94c57e837bd76e7fd71616eef2c6e38e9b9","head":{"label":"TimHugh:issue#1","ref":"issue#1","sha":"8c62e94c57e837bd76e7fd71616eef2c6e38e9b9","user":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"repo":{"id":31570380,"name":"CF-fizzbuzz","full_name":"TimHugh/CF-fizzbuzz","owner":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TimHugh/CF-fizzbuzz","description":"","fork":false,"url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz","forks_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/forks","keys_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/teams","hooks_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/hooks","issue_events_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/events{/number}","events_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/events","assignees_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/assignees{/user}","branches_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/branches{/branch}","tags_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/tags","blobs_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/refs{/sha}","trees_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/statuses/{sha}","languages_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/languages","stargazers_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/stargazers","contributors_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/contributors","subscribers_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/subscribers","subscription_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/subscription","commits_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/commits{/sha}","git_commits_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/commits{/sha}","comments_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/comments{/number}","issue_comment_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/comments{/number}","contents_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/contents/{+path}","compare_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/merges","archive_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/downloads","issues_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues{/number}","pulls_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls{/number}","milestones_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/milestones{/number}","notifications_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/labels{/name}","releases_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/releases{/id}","created_at":"2015-03-03T00:04:32Z","updated_at":"2015-03-03T00:04:32Z","pushed_at":"2015-03-03T00:24:19Z","git_url":"git://github.com/TimHugh/CF-fizzbuzz.git","ssh_url":"git@github.com:TimHugh/CF-fizzbuzz.git","clone_url":"https://github.com/TimHugh/CF-fizzbuzz.git","svn_url":"https://github.com/TimHugh/CF-fizzbuzz","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":"TimHugh:master","ref":"master","sha":"77e6ba3527c8abb7bdf080c6b90ff082c4f57f6b","user":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"repo":{"id":31570380,"name":"CF-fizzbuzz","full_name":"TimHugh/CF-fizzbuzz","owner":{"login":"TimHugh","id":1452403,"avatar_url":"https://avatars.githubusercontent.com/u/1452403?v=3","gravatar_id":"","url":"https://api.github.com/users/TimHugh","html_url":"https://github.com/TimHugh","followers_url":"https://api.github.com/users/TimHugh/followers","following_url":"https://api.github.com/users/TimHugh/following{/other_user}","gists_url":"https://api.github.com/users/TimHugh/gists{/gist_id}","starred_url":"https://api.github.com/users/TimHugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimHugh/subscriptions","organizations_url":"https://api.github.com/users/TimHugh/orgs","repos_url":"https://api.github.com/users/TimHugh/repos","events_url":"https://api.github.com/users/TimHugh/events{/privacy}","received_events_url":"https://api.github.com/users/TimHugh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TimHugh/CF-fizzbuzz","description":"","fork":false,"url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz","forks_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/forks","keys_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/teams","hooks_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/hooks","issue_events_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/events{/number}","events_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/events","assignees_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/assignees{/user}","branches_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/branches{/branch}","tags_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/tags","blobs_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/refs{/sha}","trees_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/statuses/{sha}","languages_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/languages","stargazers_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/stargazers","contributors_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/contributors","subscribers_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/subscribers","subscription_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/subscription","commits_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/commits{/sha}","git_commits_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/git/commits{/sha}","comments_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/comments{/number}","issue_comment_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/comments{/number}","contents_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/contents/{+path}","compare_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/merges","archive_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/downloads","issues_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues{/number}","pulls_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls{/number}","milestones_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/milestones{/number}","notifications_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/labels{/name}","releases_url":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/releases{/id}","created_at":"2015-03-03T00:04:32Z","updated_at":"2015-03-03T00:04:32Z","pushed_at":"2015-03-03T00:24:19Z","git_url":"git://github.com/TimHugh/CF-fizzbuzz.git","ssh_url":"git@github.com:TimHugh/CF-fizzbuzz.git","clone_url":"https://github.com/TimHugh/CF-fizzbuzz.git","svn_url":"https://github.com/TimHugh/CF-fizzbuzz","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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/TimHugh/CF-fizzbuzz/pulls/2"},"html":{"href":"https://github.com/TimHugh/CF-fizzbuzz/pull/2"},"issue":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/2"},"comments":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/TimHugh/CF-fizzbuzz/statuses/8c62e94c57e837bd76e7fd71616eef2c6e38e9b9"}}}}