{"action":"created","comment":{"url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/comments/23888103","id":23888103,"diff_hunk":"@@ -1,6 +1,36 @@\n class RomanNumeral\n+  def initialize(x)\n+    @number = x\n+  end\n \n-  # code code code\n-  # what? why?\n+  def to_arabic\n+    symbols = {\n+      'CM' => 900,\n+      'CD' => 400,\n+      'XC' => 90,\n+      'XL' => 40,\n+      'IX' => 9,\n+      'IV' => 4,\n+      'M' => 1000,\n+      'D' => 500,\n+      'C' => 100,\n+      'L' => 50,\n+      'X' => 10,\n+      'V' => 5,\n+      'I' => 1\n+    }\n+    return symbols[@number] unless symbols[@number].nil?\n \n-end\n\\ No newline at end of file\n+    result = 0\n+    while @number != ''\n+      symbols.each do |roman, arabic|\n+        if @number.include? roman\n+          @number.slice! roman\n+          result += symbols[roman]\n+          return result += symbols[@number] unless symbols[@number].nil?\n+          break\n+        end\n+      end\n+    end","path":"roman_to_arabic_numeral/roman_to_arabic.rb","position":38,"original_position":38,"commit_id":"db05fa9ffdf41671b48cad40399fe5449e2168d0","original_commit_id":"db05fa9ffdf41671b48cad40399fe5449e2168d0","user":{"login":"joneslee85","id":135605,"avatar_url":"https://avatars.githubusercontent.com/u/135605?v=3","gravatar_id":"","url":"https://api.github.com/users/joneslee85","html_url":"https://github.com/joneslee85","followers_url":"https://api.github.com/users/joneslee85/followers","following_url":"https://api.github.com/users/joneslee85/following{/other_user}","gists_url":"https://api.github.com/users/joneslee85/gists{/gist_id}","starred_url":"https://api.github.com/users/joneslee85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joneslee85/subscriptions","organizations_url":"https://api.github.com/users/joneslee85/orgs","repos_url":"https://api.github.com/users/joneslee85/repos","events_url":"https://api.github.com/users/joneslee85/events{/privacy}","received_events_url":"https://api.github.com/users/joneslee85/received_events","type":"User","site_admin":false},"body":"it'd best to return `result` here","created_at":"2015-01-31T10:25:05Z","updated_at":"2015-01-31T10:25:05Z","html_url":"https://github.com/ruby-vietnam/hacknite/pull/15#discussion_r23888103","pull_request_url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/comments/23888103"},"html":{"href":"https://github.com/ruby-vietnam/hacknite/pull/15#discussion_r23888103"},"pull_request":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15","id":28412912,"html_url":"https://github.com/ruby-vietnam/hacknite/pull/15","diff_url":"https://github.com/ruby-vietnam/hacknite/pull/15.diff","patch_url":"https://github.com/ruby-vietnam/hacknite/pull/15.patch","issue_url":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/15","number":15,"state":"open","locked":false,"title":"Roman to arabic","user":{"login":"vumanhcuongit","id":2767287,"avatar_url":"https://avatars.githubusercontent.com/u/2767287?v=3","gravatar_id":"","url":"https://api.github.com/users/vumanhcuongit","html_url":"https://github.com/vumanhcuongit","followers_url":"https://api.github.com/users/vumanhcuongit/followers","following_url":"https://api.github.com/users/vumanhcuongit/following{/other_user}","gists_url":"https://api.github.com/users/vumanhcuongit/gists{/gist_id}","starred_url":"https://api.github.com/users/vumanhcuongit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vumanhcuongit/subscriptions","organizations_url":"https://api.github.com/users/vumanhcuongit/orgs","repos_url":"https://api.github.com/users/vumanhcuongit/repos","events_url":"https://api.github.com/users/vumanhcuongit/events{/privacy}","received_events_url":"https://api.github.com/users/vumanhcuongit/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-31T10:10:45Z","updated_at":"2015-01-31T10:25:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"591029f8f30aea69373c78678724ab9ecbfcf2c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15/commits","review_comments_url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15/comments","review_comment_url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/15/comments","statuses_url":"https://api.github.com/repos/ruby-vietnam/hacknite/statuses/db05fa9ffdf41671b48cad40399fe5449e2168d0","head":{"label":"vumanhcuongit:roman_to_arabic","ref":"roman_to_arabic","sha":"db05fa9ffdf41671b48cad40399fe5449e2168d0","user":{"login":"vumanhcuongit","id":2767287,"avatar_url":"https://avatars.githubusercontent.com/u/2767287?v=3","gravatar_id":"","url":"https://api.github.com/users/vumanhcuongit","html_url":"https://github.com/vumanhcuongit","followers_url":"https://api.github.com/users/vumanhcuongit/followers","following_url":"https://api.github.com/users/vumanhcuongit/following{/other_user}","gists_url":"https://api.github.com/users/vumanhcuongit/gists{/gist_id}","starred_url":"https://api.github.com/users/vumanhcuongit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vumanhcuongit/subscriptions","organizations_url":"https://api.github.com/users/vumanhcuongit/orgs","repos_url":"https://api.github.com/users/vumanhcuongit/repos","events_url":"https://api.github.com/users/vumanhcuongit/events{/privacy}","received_events_url":"https://api.github.com/users/vumanhcuongit/received_events","type":"User","site_admin":false},"repo":{"id":30106648,"name":"hacknite","full_name":"vumanhcuongit/hacknite","owner":{"login":"vumanhcuongit","id":2767287,"avatar_url":"https://avatars.githubusercontent.com/u/2767287?v=3","gravatar_id":"","url":"https://api.github.com/users/vumanhcuongit","html_url":"https://github.com/vumanhcuongit","followers_url":"https://api.github.com/users/vumanhcuongit/followers","following_url":"https://api.github.com/users/vumanhcuongit/following{/other_user}","gists_url":"https://api.github.com/users/vumanhcuongit/gists{/gist_id}","starred_url":"https://api.github.com/users/vumanhcuongit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vumanhcuongit/subscriptions","organizations_url":"https://api.github.com/users/vumanhcuongit/orgs","repos_url":"https://api.github.com/users/vumanhcuongit/repos","events_url":"https://api.github.com/users/vumanhcuongit/events{/privacy}","received_events_url":"https://api.github.com/users/vumanhcuongit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vumanhcuongit/hacknite","description":"God dammit! We hack! We slash!","fork":true,"url":"https://api.github.com/repos/vumanhcuongit/hacknite","forks_url":"https://api.github.com/repos/vumanhcuongit/hacknite/forks","keys_url":"https://api.github.com/repos/vumanhcuongit/hacknite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vumanhcuongit/hacknite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vumanhcuongit/hacknite/teams","hooks_url":"https://api.github.com/repos/vumanhcuongit/hacknite/hooks","issue_events_url":"https://api.github.com/repos/vumanhcuongit/hacknite/issues/events{/number}","events_url":"https://api.github.com/repos/vumanhcuongit/hacknite/events","assignees_url":"https://api.github.com/repos/vumanhcuongit/hacknite/assignees{/user}","branches_url":"https://api.github.com/repos/vumanhcuongit/hacknite/branches{/branch}","tags_url":"https://api.github.com/repos/vumanhcuongit/hacknite/tags","blobs_url":"https://api.github.com/repos/vumanhcuongit/hacknite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vumanhcuongit/hacknite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vumanhcuongit/hacknite/git/refs{/sha}","trees_url":"https://api.github.com/repos/vumanhcuongit/hacknite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vumanhcuongit/hacknite/statuses/{sha}","languages_url":"https://api.github.com/repos/vumanhcuongit/hacknite/languages","stargazers_url":"https://api.github.com/repos/vumanhcuongit/hacknite/stargazers","contributors_url":"https://api.github.com/repos/vumanhcuongit/hacknite/contributors","subscribers_url":"https://api.github.com/repos/vumanhcuongit/hacknite/subscribers","subscription_url":"https://api.github.com/repos/vumanhcuongit/hacknite/subscription","commits_url":"https://api.github.com/repos/vumanhcuongit/hacknite/commits{/sha}","git_commits_url":"https://api.github.com/repos/vumanhcuongit/hacknite/git/commits{/sha}","comments_url":"https://api.github.com/repos/vumanhcuongit/hacknite/comments{/number}","issue_comment_url":"https://api.github.com/repos/vumanhcuongit/hacknite/issues/comments/{number}","contents_url":"https://api.github.com/repos/vumanhcuongit/hacknite/contents/{+path}","compare_url":"https://api.github.com/repos/vumanhcuongit/hacknite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vumanhcuongit/hacknite/merges","archive_url":"https://api.github.com/repos/vumanhcuongit/hacknite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vumanhcuongit/hacknite/downloads","issues_url":"https://api.github.com/repos/vumanhcuongit/hacknite/issues{/number}","pulls_url":"https://api.github.com/repos/vumanhcuongit/hacknite/pulls{/number}","milestones_url":"https://api.github.com/repos/vumanhcuongit/hacknite/milestones{/number}","notifications_url":"https://api.github.com/repos/vumanhcuongit/hacknite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vumanhcuongit/hacknite/labels{/name}","releases_url":"https://api.github.com/repos/vumanhcuongit/hacknite/releases{/id}","created_at":"2015-01-31T08:11:17Z","updated_at":"2015-01-31T10:02:28Z","pushed_at":"2015-01-31T10:10:15Z","git_url":"git://github.com/vumanhcuongit/hacknite.git","ssh_url":"git@github.com:vumanhcuongit/hacknite.git","clone_url":"https://github.com/vumanhcuongit/hacknite.git","svn_url":"https://github.com/vumanhcuongit/hacknite","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":"ruby-vietnam:master","ref":"master","sha":"a3abd71f30c447e833a02c46f4b61831a67b6c2b","user":{"login":"ruby-vietnam","id":6779513,"avatar_url":"https://avatars.githubusercontent.com/u/6779513?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-vietnam","html_url":"https://github.com/ruby-vietnam","followers_url":"https://api.github.com/users/ruby-vietnam/followers","following_url":"https://api.github.com/users/ruby-vietnam/following{/other_user}","gists_url":"https://api.github.com/users/ruby-vietnam/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-vietnam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-vietnam/subscriptions","organizations_url":"https://api.github.com/users/ruby-vietnam/orgs","repos_url":"https://api.github.com/users/ruby-vietnam/repos","events_url":"https://api.github.com/users/ruby-vietnam/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-vietnam/received_events","type":"Organization","site_admin":false},"repo":{"id":25507451,"name":"hacknite","full_name":"ruby-vietnam/hacknite","owner":{"login":"ruby-vietnam","id":6779513,"avatar_url":"https://avatars.githubusercontent.com/u/6779513?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-vietnam","html_url":"https://github.com/ruby-vietnam","followers_url":"https://api.github.com/users/ruby-vietnam/followers","following_url":"https://api.github.com/users/ruby-vietnam/following{/other_user}","gists_url":"https://api.github.com/users/ruby-vietnam/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-vietnam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-vietnam/subscriptions","organizations_url":"https://api.github.com/users/ruby-vietnam/orgs","repos_url":"https://api.github.com/users/ruby-vietnam/repos","events_url":"https://api.github.com/users/ruby-vietnam/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-vietnam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-vietnam/hacknite","description":"God dammit! We hack! We slash!","fork":false,"url":"https://api.github.com/repos/ruby-vietnam/hacknite","forks_url":"https://api.github.com/repos/ruby-vietnam/hacknite/forks","keys_url":"https://api.github.com/repos/ruby-vietnam/hacknite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-vietnam/hacknite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-vietnam/hacknite/teams","hooks_url":"https://api.github.com/repos/ruby-vietnam/hacknite/hooks","issue_events_url":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-vietnam/hacknite/events","assignees_url":"https://api.github.com/repos/ruby-vietnam/hacknite/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-vietnam/hacknite/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-vietnam/hacknite/tags","blobs_url":"https://api.github.com/repos/ruby-vietnam/hacknite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-vietnam/hacknite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-vietnam/hacknite/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-vietnam/hacknite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-vietnam/hacknite/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-vietnam/hacknite/languages","stargazers_url":"https://api.github.com/repos/ruby-vietnam/hacknite/stargazers","contributors_url":"https://api.github.com/repos/ruby-vietnam/hacknite/contributors","subscribers_url":"https://api.github.com/repos/ruby-vietnam/hacknite/subscribers","subscription_url":"https://api.github.com/repos/ruby-vietnam/hacknite/subscription","commits_url":"https://api.github.com/repos/ruby-vietnam/hacknite/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-vietnam/hacknite/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-vietnam/hacknite/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/comments/{number}","contents_url":"https://api.github.com/repos/ruby-vietnam/hacknite/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-vietnam/hacknite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-vietnam/hacknite/merges","archive_url":"https://api.github.com/repos/ruby-vietnam/hacknite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-vietnam/hacknite/downloads","issues_url":"https://api.github.com/repos/ruby-vietnam/hacknite/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-vietnam/hacknite/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-vietnam/hacknite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-vietnam/hacknite/labels{/name}","releases_url":"https://api.github.com/repos/ruby-vietnam/hacknite/releases{/id}","created_at":"2014-10-21T07:01:57Z","updated_at":"2015-01-30T11:56:52Z","pushed_at":"2015-01-30T11:56:51Z","git_url":"git://github.com/ruby-vietnam/hacknite.git","ssh_url":"git@github.com:ruby-vietnam/hacknite.git","clone_url":"https://github.com/ruby-vietnam/hacknite.git","svn_url":"https://github.com/ruby-vietnam/hacknite","homepage":"","size":164,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15"},"html":{"href":"https://github.com/ruby-vietnam/hacknite/pull/15"},"issue":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/15"},"comments":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-vietnam/hacknite/statuses/db05fa9ffdf41671b48cad40399fe5449e2168d0"}}}}