{"action":"created","comment":{"url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/comments/70067609","id":70067609,"diff_hunk":"@@ -1,17 +1,64 @@\n class Fraction\n   def initialize(numerator, denominator)\n-    if !(numerator.is_a?(Integer) && denominator.is_a?(Integer))\n-      # TODO: create a proper exception for that issue\n-      # TODO: handle case when one or both parameters are not Integer but could be easily transformed into it\n-      # by using #to_i\n-      raise 'At least some arguments are incorrect: ' + numerator.inspect + ', ' + denominator.inspect\n+    if ! numerator.is_a?(Integer) && denominator.is_a?(Integer)\n+      # TODO: Proper execption for this issue\n+      # TODO: Handle case when one or both parameters are not int but could be easily transformed to int\n+      raise 'these are supposed to be numbers: '+numerator.inspect+' '+ denominator.inspect\n     end\n     @numerator = numerator\n     @denominator = denominator\n   end\n+\n+  def numerator\n+    @numerator\n+  end\n+\n+  def denominator\n+    @denominator\n+  end\n+\n+  def simplify\n+\n+=begin\n+     if @numerator > @denominator then b=@denominator else b=@numerator\n+    end\n+    end\n+\n+    while b>1\n+     if (@numerator%b == 0 and @denominator%b == 0)\n+       @denominator = @denominator /b\n+       @numerator = @numerator /b\n+     end\n+      b=b-1\n+=end\n+    Fraction.new(@numerator / @numerator.gcd(@denominator), @denominator / @denominator.gcd(@numerator))\n+  end\n+\n+  def view\n+      puts \"#{@numerator}/#{@denominator}\"\n+  end\n+\n+  def +(a)\n+    Fraction.new(@numerator*a.denominator+a.numerator*@denominator, @denominator*a.denominator).simplify\n+  end\n+\n+  def *(a)\n+    Fraction.new(@numerator = @numerator*a.numerator, @denominator = @denominator*a.denominator).simplify\n+  end\n+\n+  def /(a)\n+    Fraction.new(@numerator*a.denominator, @denominator*a.numerator).simplify\n+  end\n+\n+  def -(a)\n+    simplify","path":"fraction.rb","position":59,"original_position":59,"commit_id":"2e85fe994fbf541c540c154f0167f532072d3841","original_commit_id":"2e85fe994fbf541c540c154f0167f532072d3841","user":{"login":"nonkor","id":6322897,"avatar_url":"https://avatars.githubusercontent.com/u/6322897?v=3","gravatar_id":"","url":"https://api.github.com/users/nonkor","html_url":"https://github.com/nonkor","followers_url":"https://api.github.com/users/nonkor/followers","following_url":"https://api.github.com/users/nonkor/following{/other_user}","gists_url":"https://api.github.com/users/nonkor/gists{/gist_id}","starred_url":"https://api.github.com/users/nonkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonkor/subscriptions","organizations_url":"https://api.github.com/users/nonkor/orgs","repos_url":"https://api.github.com/users/nonkor/repos","events_url":"https://api.github.com/users/nonkor/events{/privacy}","received_events_url":"https://api.github.com/users/nonkor/received_events","type":"User","site_admin":false},"body":"This and next line do **nothing**.","created_at":"2016-07-08T12:42:22Z","updated_at":"2016-07-08T12:42:22Z","html_url":"https://github.com/nonkor/Betlab-ruby-courses/pull/1#discussion_r70067609","pull_request_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/comments/70067609"},"html":{"href":"https://github.com/nonkor/Betlab-ruby-courses/pull/1#discussion_r70067609"},"pull_request":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1","id":76456748,"html_url":"https://github.com/nonkor/Betlab-ruby-courses/pull/1","diff_url":"https://github.com/nonkor/Betlab-ruby-courses/pull/1.diff","patch_url":"https://github.com/nonkor/Betlab-ruby-courses/pull/1.patch","issue_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/1","number":1,"state":"open","locked":false,"title":"Update fraction.rb","user":{"login":"atomski","id":20204201,"avatar_url":"https://avatars.githubusercontent.com/u/20204201?v=3","gravatar_id":"","url":"https://api.github.com/users/atomski","html_url":"https://github.com/atomski","followers_url":"https://api.github.com/users/atomski/followers","following_url":"https://api.github.com/users/atomski/following{/other_user}","gists_url":"https://api.github.com/users/atomski/gists{/gist_id}","starred_url":"https://api.github.com/users/atomski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomski/subscriptions","organizations_url":"https://api.github.com/users/atomski/orgs","repos_url":"https://api.github.com/users/atomski/repos","events_url":"https://api.github.com/users/atomski/events{/privacy}","received_events_url":"https://api.github.com/users/atomski/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-06T15:56:32Z","updated_at":"2016-07-08T12:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b50c8eced3624445e46dfbe06fa9436797981fb9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1/commits","review_comments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1/comments","review_comment_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/1/comments","statuses_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/statuses/2e85fe994fbf541c540c154f0167f532072d3841","head":{"label":"nonkor:atomski-Fractionhometask","ref":"atomski-Fractionhometask","sha":"2e85fe994fbf541c540c154f0167f532072d3841","user":{"login":"nonkor","id":6322897,"avatar_url":"https://avatars.githubusercontent.com/u/6322897?v=3","gravatar_id":"","url":"https://api.github.com/users/nonkor","html_url":"https://github.com/nonkor","followers_url":"https://api.github.com/users/nonkor/followers","following_url":"https://api.github.com/users/nonkor/following{/other_user}","gists_url":"https://api.github.com/users/nonkor/gists{/gist_id}","starred_url":"https://api.github.com/users/nonkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonkor/subscriptions","organizations_url":"https://api.github.com/users/nonkor/orgs","repos_url":"https://api.github.com/users/nonkor/repos","events_url":"https://api.github.com/users/nonkor/events{/privacy}","received_events_url":"https://api.github.com/users/nonkor/received_events","type":"User","site_admin":false},"repo":{"id":62125114,"name":"Betlab-ruby-courses","full_name":"nonkor/Betlab-ruby-courses","owner":{"login":"nonkor","id":6322897,"avatar_url":"https://avatars.githubusercontent.com/u/6322897?v=3","gravatar_id":"","url":"https://api.github.com/users/nonkor","html_url":"https://github.com/nonkor","followers_url":"https://api.github.com/users/nonkor/followers","following_url":"https://api.github.com/users/nonkor/following{/other_user}","gists_url":"https://api.github.com/users/nonkor/gists{/gist_id}","starred_url":"https://api.github.com/users/nonkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonkor/subscriptions","organizations_url":"https://api.github.com/users/nonkor/orgs","repos_url":"https://api.github.com/users/nonkor/repos","events_url":"https://api.github.com/users/nonkor/events{/privacy}","received_events_url":"https://api.github.com/users/nonkor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nonkor/Betlab-ruby-courses","description":"This project is created for storing and tracking actual progress of Betlab Ruby Courses","fork":false,"url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses","forks_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/forks","keys_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/teams","hooks_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/hooks","issue_events_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/events{/number}","events_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/events","assignees_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/assignees{/user}","branches_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/branches{/branch}","tags_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/tags","blobs_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/languages","stargazers_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/stargazers","contributors_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/contributors","subscribers_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/subscribers","subscription_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/subscription","commits_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/contents/{+path}","compare_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/merges","archive_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/downloads","issues_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues{/number}","pulls_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/labels{/name}","releases_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/releases{/id}","deployments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/deployments","created_at":"2016-06-28T08:48:05Z","updated_at":"2016-06-28T09:02:23Z","pushed_at":"2016-07-06T15:56:32Z","git_url":"git://github.com/nonkor/Betlab-ruby-courses.git","ssh_url":"git@github.com:nonkor/Betlab-ruby-courses.git","clone_url":"https://github.com/nonkor/Betlab-ruby-courses.git","svn_url":"https://github.com/nonkor/Betlab-ruby-courses","homepage":null,"size":15,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nonkor:master","ref":"master","sha":"43fd573a4d87ab0034107f1fc0541096ce12ca34","user":{"login":"nonkor","id":6322897,"avatar_url":"https://avatars.githubusercontent.com/u/6322897?v=3","gravatar_id":"","url":"https://api.github.com/users/nonkor","html_url":"https://github.com/nonkor","followers_url":"https://api.github.com/users/nonkor/followers","following_url":"https://api.github.com/users/nonkor/following{/other_user}","gists_url":"https://api.github.com/users/nonkor/gists{/gist_id}","starred_url":"https://api.github.com/users/nonkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonkor/subscriptions","organizations_url":"https://api.github.com/users/nonkor/orgs","repos_url":"https://api.github.com/users/nonkor/repos","events_url":"https://api.github.com/users/nonkor/events{/privacy}","received_events_url":"https://api.github.com/users/nonkor/received_events","type":"User","site_admin":false},"repo":{"id":62125114,"name":"Betlab-ruby-courses","full_name":"nonkor/Betlab-ruby-courses","owner":{"login":"nonkor","id":6322897,"avatar_url":"https://avatars.githubusercontent.com/u/6322897?v=3","gravatar_id":"","url":"https://api.github.com/users/nonkor","html_url":"https://github.com/nonkor","followers_url":"https://api.github.com/users/nonkor/followers","following_url":"https://api.github.com/users/nonkor/following{/other_user}","gists_url":"https://api.github.com/users/nonkor/gists{/gist_id}","starred_url":"https://api.github.com/users/nonkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonkor/subscriptions","organizations_url":"https://api.github.com/users/nonkor/orgs","repos_url":"https://api.github.com/users/nonkor/repos","events_url":"https://api.github.com/users/nonkor/events{/privacy}","received_events_url":"https://api.github.com/users/nonkor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nonkor/Betlab-ruby-courses","description":"This project is created for storing and tracking actual progress of Betlab Ruby Courses","fork":false,"url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses","forks_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/forks","keys_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/teams","hooks_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/hooks","issue_events_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/events{/number}","events_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/events","assignees_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/assignees{/user}","branches_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/branches{/branch}","tags_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/tags","blobs_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/languages","stargazers_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/stargazers","contributors_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/contributors","subscribers_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/subscribers","subscription_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/subscription","commits_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/contents/{+path}","compare_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/merges","archive_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/downloads","issues_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues{/number}","pulls_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/labels{/name}","releases_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/releases{/id}","deployments_url":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/deployments","created_at":"2016-06-28T08:48:05Z","updated_at":"2016-06-28T09:02:23Z","pushed_at":"2016-07-06T15:56:32Z","git_url":"git://github.com/nonkor/Betlab-ruby-courses.git","ssh_url":"git@github.com:nonkor/Betlab-ruby-courses.git","clone_url":"https://github.com/nonkor/Betlab-ruby-courses.git","svn_url":"https://github.com/nonkor/Betlab-ruby-courses","homepage":null,"size":15,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1"},"html":{"href":"https://github.com/nonkor/Betlab-ruby-courses/pull/1"},"issue":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/1"},"comments":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/nonkor/Betlab-ruby-courses/statuses/2e85fe994fbf541c540c154f0167f532072d3841"}}}}
{"actor":{"display_login":"nonkor"}}