{"action":"created","comment":{"url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/31459286","id":31459286,"diff_hunk":"@@ -1,58 +1,63 @@\n # Killer facts about triangles AWW YEAH\n class Triangle\n-\tattr_accessor :side1,:side2,:side3\n-\n-\tdef initialize(side1,side2,side3)\n-\t\t@side1,@side2,@side3 = side1,side2,side3\n-\tend\n-\n-\tdef equilateral()\n-\t\treturn side1 == side2 && side2 == side3\n-\tend\n-\n-\tdef isosceles()\n-\t\treturn [side1,side2,side3].uniq.length == 2\n-\tend\n-\n-\tdef scalene()\n-\t\tunless ! (equilateral || isosceles)\n-\t    false\n-\t  else\n-\t    true\n-\t  end\n-\tend\n-\n-\tdef recite_facts\n-\t\tputs 'This triangle is equilateral!' if equilateral\n-\t\tputs 'This triangle is isosceles! Also, that word is hard to type.' if isosceles \n-\t\tputs 'This triangle is scalene and mathematically boring.' if scalene \n-\n-\t\tangles = self.calculate_angles(side1,side2,side3)\n-\t\tputs 'The angles of this triangle are ' + angles.join(',')\n-\n-\t\tputs 'This triangle is also a right triangle!' if angles.include? 90\n-\t\tputs ''\n-\tend\n-\n-\tdef calculate_angles(a,b,c)\n-\t\tangleA = radians_to_degrees(Math.acos((b**2 + c**2 - a**2) / (2.0 * b * c)))\n-\t\tangleB = radians_to_degrees(Math.acos((a**2 + c**2 - b**2) / (2.0 * a * c)))\n-\t\tangleC = radians_to_degrees(Math.acos((a**2 + b**2 - c**2) / (2.0 * a * b)))\n-\n-\t\treturn [angleA, angleB, angleC]\n-\tend\n-\n-\tdef radians_to_degrees(rads)\n-\t\treturn (rads * 180 / Math::PI).round\n-\tend\n+  attr_accessor :side1, :side2, :side3\n+\n+  def initialize(side1, side2, side3)\n+    @side1 = side1\n+    @side2 = side2\n+    @side3 = side3\n+  end\n+\n+  def equilateral?\n+    side1 == side2 && side2 == side3\n+  end\n+\n+  def isosceles?\n+    [side1, side2, side3].uniq.length == 2\n+  end\n+\n+  def scalene?\n+    !(equilateral? || scalene?)\n+  end\n+\n+  def recite_facts\n+    puts type_message\n+    puts angle_message\n+  end\n+\n+  def type_message\n+    if equilateral?\n+      'This triangle is equilateral!'\n+    elsif isosceles?\n+      'This triangle is isosceles! Also, that word is hard to type.'\n+    else\n+      'This triangle is scalene and mathematically boring.'\n+    end\n+  end\n+\n+  def angle_message\n+    angles = calculate_angles(side1, side2, side3)\n+\n+    msg = 'The angles of this triangle are ' + angles.join(',')\n+    msg += \"\\nThis triangle is also a right triangle!\" if angles.include? 90\n+    msg + \"\\n\\n\"\n+  end\n+\n+  def calculate_angles(a, b, c)\n+    angle_a = calculate_angle(a, b, c)\n+    angle_b = calculate_angle(b, c, a)\n+    angle_c = calculate_angle(c, a, b)\n+\n+    [angle_a, angle_b, angle_c]\n+  end\n+\n+  def calculate_angle(m, n, o)","path":"triangle_facts/triangle_facts.rb","position":99,"original_position":99,"commit_id":"bf371e9fc2df0cf4184d6098941745acbf80e07f","original_commit_id":"bf371e9fc2df0cf4184d6098941745acbf80e07f","user":{"login":"djkotowski","id":2326295,"avatar_url":"https://avatars.githubusercontent.com/u/2326295?v=3","gravatar_id":"","url":"https://api.github.com/users/djkotowski","html_url":"https://github.com/djkotowski","followers_url":"https://api.github.com/users/djkotowski/followers","following_url":"https://api.github.com/users/djkotowski/following{/other_user}","gists_url":"https://api.github.com/users/djkotowski/gists{/gist_id}","starred_url":"https://api.github.com/users/djkotowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djkotowski/subscriptions","organizations_url":"https://api.github.com/users/djkotowski/orgs","repos_url":"https://api.github.com/users/djkotowski/repos","events_url":"https://api.github.com/users/djkotowski/events{/privacy}","received_events_url":"https://api.github.com/users/djkotowski/received_events","type":"User","site_admin":false},"body":"Prefer using var names that are more descriptive.","created_at":"2015-06-01T19:13:36Z","updated_at":"2015-06-01T19:13:36Z","html_url":"https://github.com/jmmastey/level_up_exercises/pull/698#discussion_r31459286","pull_request_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698","_links":{"self":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments/31459286"},"html":{"href":"https://github.com/jmmastey/level_up_exercises/pull/698#discussion_r31459286"},"pull_request":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698"}}},"pull_request":{"url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698","id":36427840,"html_url":"https://github.com/jmmastey/level_up_exercises/pull/698","diff_url":"https://github.com/jmmastey/level_up_exercises/pull/698.diff","patch_url":"https://github.com/jmmastey/level_up_exercises/pull/698.patch","issue_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/698","number":698,"state":"open","locked":false,"title":"Triangle facts","user":{"login":"chichiwang","id":2304118,"avatar_url":"https://avatars.githubusercontent.com/u/2304118?v=3","gravatar_id":"","url":"https://api.github.com/users/chichiwang","html_url":"https://github.com/chichiwang","followers_url":"https://api.github.com/users/chichiwang/followers","following_url":"https://api.github.com/users/chichiwang/following{/other_user}","gists_url":"https://api.github.com/users/chichiwang/gists{/gist_id}","starred_url":"https://api.github.com/users/chichiwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chichiwang/subscriptions","organizations_url":"https://api.github.com/users/chichiwang/orgs","repos_url":"https://api.github.com/users/chichiwang/repos","events_url":"https://api.github.com/users/chichiwang/events{/privacy}","received_events_url":"https://api.github.com/users/chichiwang/received_events","type":"User","site_admin":false},"body":"* Uniform whitespaces (2-space tabs, no hard tabs)\r\n* Rename predicate methods according to convention\r\n* Simplify confusing logic in `scalene` method\r\n* Break out logic in `recite_facts` and `calculate_angles` methods for legibility","created_at":"2015-05-28T16:53:36Z","updated_at":"2015-06-01T19:13:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b1f456007c2386a35954a174c624423d7972656","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698/commits","review_comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698/comments","review_comment_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/698/comments","statuses_url":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/bf371e9fc2df0cf4184d6098941745acbf80e07f","head":{"label":"chichiwang:triangle_facts","ref":"triangle_facts","sha":"bf371e9fc2df0cf4184d6098941745acbf80e07f","user":{"login":"chichiwang","id":2304118,"avatar_url":"https://avatars.githubusercontent.com/u/2304118?v=3","gravatar_id":"","url":"https://api.github.com/users/chichiwang","html_url":"https://github.com/chichiwang","followers_url":"https://api.github.com/users/chichiwang/followers","following_url":"https://api.github.com/users/chichiwang/following{/other_user}","gists_url":"https://api.github.com/users/chichiwang/gists{/gist_id}","starred_url":"https://api.github.com/users/chichiwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chichiwang/subscriptions","organizations_url":"https://api.github.com/users/chichiwang/orgs","repos_url":"https://api.github.com/users/chichiwang/repos","events_url":"https://api.github.com/users/chichiwang/events{/privacy}","received_events_url":"https://api.github.com/users/chichiwang/received_events","type":"User","site_admin":false},"repo":{"id":35954836,"name":"level_up_exercises","full_name":"chichiwang/level_up_exercises","owner":{"login":"chichiwang","id":2304118,"avatar_url":"https://avatars.githubusercontent.com/u/2304118?v=3","gravatar_id":"","url":"https://api.github.com/users/chichiwang","html_url":"https://github.com/chichiwang","followers_url":"https://api.github.com/users/chichiwang/followers","following_url":"https://api.github.com/users/chichiwang/following{/other_user}","gists_url":"https://api.github.com/users/chichiwang/gists{/gist_id}","starred_url":"https://api.github.com/users/chichiwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chichiwang/subscriptions","organizations_url":"https://api.github.com/users/chichiwang/orgs","repos_url":"https://api.github.com/users/chichiwang/repos","events_url":"https://api.github.com/users/chichiwang/events{/privacy}","received_events_url":"https://api.github.com/users/chichiwang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chichiwang/level_up_exercises","description":"A series of code-related assignments to challenge starting engineers","fork":true,"url":"https://api.github.com/repos/chichiwang/level_up_exercises","forks_url":"https://api.github.com/repos/chichiwang/level_up_exercises/forks","keys_url":"https://api.github.com/repos/chichiwang/level_up_exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chichiwang/level_up_exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chichiwang/level_up_exercises/teams","hooks_url":"https://api.github.com/repos/chichiwang/level_up_exercises/hooks","issue_events_url":"https://api.github.com/repos/chichiwang/level_up_exercises/issues/events{/number}","events_url":"https://api.github.com/repos/chichiwang/level_up_exercises/events","assignees_url":"https://api.github.com/repos/chichiwang/level_up_exercises/assignees{/user}","branches_url":"https://api.github.com/repos/chichiwang/level_up_exercises/branches{/branch}","tags_url":"https://api.github.com/repos/chichiwang/level_up_exercises/tags","blobs_url":"https://api.github.com/repos/chichiwang/level_up_exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chichiwang/level_up_exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chichiwang/level_up_exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/chichiwang/level_up_exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chichiwang/level_up_exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/chichiwang/level_up_exercises/languages","stargazers_url":"https://api.github.com/repos/chichiwang/level_up_exercises/stargazers","contributors_url":"https://api.github.com/repos/chichiwang/level_up_exercises/contributors","subscribers_url":"https://api.github.com/repos/chichiwang/level_up_exercises/subscribers","subscription_url":"https://api.github.com/repos/chichiwang/level_up_exercises/subscription","commits_url":"https://api.github.com/repos/chichiwang/level_up_exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/chichiwang/level_up_exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/chichiwang/level_up_exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/chichiwang/level_up_exercises/issues/comments{/number}","contents_url":"https://api.github.com/repos/chichiwang/level_up_exercises/contents/{+path}","compare_url":"https://api.github.com/repos/chichiwang/level_up_exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chichiwang/level_up_exercises/merges","archive_url":"https://api.github.com/repos/chichiwang/level_up_exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chichiwang/level_up_exercises/downloads","issues_url":"https://api.github.com/repos/chichiwang/level_up_exercises/issues{/number}","pulls_url":"https://api.github.com/repos/chichiwang/level_up_exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/chichiwang/level_up_exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/chichiwang/level_up_exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chichiwang/level_up_exercises/labels{/name}","releases_url":"https://api.github.com/repos/chichiwang/level_up_exercises/releases{/id}","created_at":"2015-05-20T14:57:11Z","updated_at":"2015-05-20T14:57:12Z","pushed_at":"2015-06-01T15:17:38Z","git_url":"git://github.com/chichiwang/level_up_exercises.git","ssh_url":"git@github.com:chichiwang/level_up_exercises.git","clone_url":"https://github.com/chichiwang/level_up_exercises.git","svn_url":"https://github.com/chichiwang/level_up_exercises","homepage":"http://leveluprails.herokuapp.com","size":297,"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":"jmmastey:master","ref":"master","sha":"b941842eff3e5c5063d323069d7096d066054ef4","user":{"login":"jmmastey","id":302011,"avatar_url":"https://avatars.githubusercontent.com/u/302011?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmastey","html_url":"https://github.com/jmmastey","followers_url":"https://api.github.com/users/jmmastey/followers","following_url":"https://api.github.com/users/jmmastey/following{/other_user}","gists_url":"https://api.github.com/users/jmmastey/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmastey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmastey/subscriptions","organizations_url":"https://api.github.com/users/jmmastey/orgs","repos_url":"https://api.github.com/users/jmmastey/repos","events_url":"https://api.github.com/users/jmmastey/events{/privacy}","received_events_url":"https://api.github.com/users/jmmastey/received_events","type":"User","site_admin":false},"repo":{"id":20705648,"name":"level_up_exercises","full_name":"jmmastey/level_up_exercises","owner":{"login":"jmmastey","id":302011,"avatar_url":"https://avatars.githubusercontent.com/u/302011?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmastey","html_url":"https://github.com/jmmastey","followers_url":"https://api.github.com/users/jmmastey/followers","following_url":"https://api.github.com/users/jmmastey/following{/other_user}","gists_url":"https://api.github.com/users/jmmastey/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmastey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmastey/subscriptions","organizations_url":"https://api.github.com/users/jmmastey/orgs","repos_url":"https://api.github.com/users/jmmastey/repos","events_url":"https://api.github.com/users/jmmastey/events{/privacy}","received_events_url":"https://api.github.com/users/jmmastey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmmastey/level_up_exercises","description":"A series of code-related assignments to challenge starting engineers","fork":false,"url":"https://api.github.com/repos/jmmastey/level_up_exercises","forks_url":"https://api.github.com/repos/jmmastey/level_up_exercises/forks","keys_url":"https://api.github.com/repos/jmmastey/level_up_exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmmastey/level_up_exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmmastey/level_up_exercises/teams","hooks_url":"https://api.github.com/repos/jmmastey/level_up_exercises/hooks","issue_events_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/events{/number}","events_url":"https://api.github.com/repos/jmmastey/level_up_exercises/events","assignees_url":"https://api.github.com/repos/jmmastey/level_up_exercises/assignees{/user}","branches_url":"https://api.github.com/repos/jmmastey/level_up_exercises/branches{/branch}","tags_url":"https://api.github.com/repos/jmmastey/level_up_exercises/tags","blobs_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/jmmastey/level_up_exercises/languages","stargazers_url":"https://api.github.com/repos/jmmastey/level_up_exercises/stargazers","contributors_url":"https://api.github.com/repos/jmmastey/level_up_exercises/contributors","subscribers_url":"https://api.github.com/repos/jmmastey/level_up_exercises/subscribers","subscription_url":"https://api.github.com/repos/jmmastey/level_up_exercises/subscription","commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmmastey/level_up_exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmmastey/level_up_exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmmastey/level_up_exercises/contents/{+path}","compare_url":"https://api.github.com/repos/jmmastey/level_up_exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmmastey/level_up_exercises/merges","archive_url":"https://api.github.com/repos/jmmastey/level_up_exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmmastey/level_up_exercises/downloads","issues_url":"https://api.github.com/repos/jmmastey/level_up_exercises/issues{/number}","pulls_url":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/jmmastey/level_up_exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/jmmastey/level_up_exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmmastey/level_up_exercises/labels{/name}","releases_url":"https://api.github.com/repos/jmmastey/level_up_exercises/releases{/id}","created_at":"2014-06-10T23:42:24Z","updated_at":"2015-05-29T17:17:41Z","pushed_at":"2015-06-01T16:07:16Z","git_url":"git://github.com/jmmastey/level_up_exercises.git","ssh_url":"git@github.com:jmmastey/level_up_exercises.git","clone_url":"https://github.com/jmmastey/level_up_exercises.git","svn_url":"https://github.com/jmmastey/level_up_exercises","homepage":"http://leveluprails.herokuapp.com","size":152646,"stargazers_count":24,"watchers_count":24,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"open_issues_count":9,"forks":103,"open_issues":9,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698"},"html":{"href":"https://github.com/jmmastey/level_up_exercises/pull/698"},"issue":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/698"},"comments":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/issues/698/comments"},"review_comments":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698/comments"},"review_comment":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/pulls/698/commits"},"statuses":{"href":"https://api.github.com/repos/jmmastey/level_up_exercises/statuses/bf371e9fc2df0cf4184d6098941745acbf80e07f"}}}}