{"action":"created","comment":{"url":"https://api.github.com/repos/pustovalov/app/pulls/comments/47148102","id":47148102,"diff_hunk":"@@ -0,0 +1,55 @@\n+class SuperMemo\n+  GOOD_DELAY = 1\n+  NORMAL_DELAY = 3\n+\n+  def initialize(params)\n+    @time = Time.at(params[:time].to_f/1000).strftime(\"%M\").to_f\n+    @complexity = params[:complexity] ? (params[:complexity] < 1.3 ? 1.3 : params[:complexity]) : 2.5\n+    @times_reviewed = params[:times_reviewed]\n+    @typos = params[:typos]\n+    @word_length = params[:word_length]\n+  end\n+\n+  def response_quality\n+    if @time <= GOOD_DELAY\n+      @good_delay = true\n+    elsif @time > GOOD_DELAY and @time < NORMAL_DELAY\n+      @normal_delay = true\n+    else\n+      @bad_delay = true\n+    end\n+  end\n+\n+  def rating\n+    response_quality\n+\n+    if @good_delay and @typos.zero?","path":"app/services/super_memo.rb","position":26,"original_position":26,"commit_id":"a19fd6d672c4a0423e813217b5fcda398b705abd","original_commit_id":"a19fd6d672c4a0423e813217b5fcda398b705abd","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Use `&&` instead of `and`.","created_at":"2015-12-09T20:36:48Z","updated_at":"2015-12-09T20:36:48Z","html_url":"https://github.com/pustovalov/app/pull/19#discussion_r47148102","pull_request_url":"https://api.github.com/repos/pustovalov/app/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/pustovalov/app/pulls/comments/47148102"},"html":{"href":"https://github.com/pustovalov/app/pull/19#discussion_r47148102"},"pull_request":{"href":"https://api.github.com/repos/pustovalov/app/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/pustovalov/app/pulls/19","id":53174182,"html_url":"https://github.com/pustovalov/app/pull/19","diff_url":"https://github.com/pustovalov/app/pull/19.diff","patch_url":"https://github.com/pustovalov/app/pull/19.patch","issue_url":"https://api.github.com/repos/pustovalov/app/issues/19","number":19,"state":"open","locked":false,"title":"Supermemo","user":{"login":"pustovalov","id":1568885,"avatar_url":"https://avatars.githubusercontent.com/u/1568885?v=3","gravatar_id":"","url":"https://api.github.com/users/pustovalov","html_url":"https://github.com/pustovalov","followers_url":"https://api.github.com/users/pustovalov/followers","following_url":"https://api.github.com/users/pustovalov/following{/other_user}","gists_url":"https://api.github.com/users/pustovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/pustovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pustovalov/subscriptions","organizations_url":"https://api.github.com/users/pustovalov/orgs","repos_url":"https://api.github.com/users/pustovalov/repos","events_url":"https://api.github.com/users/pustovalov/events{/privacy}","received_events_url":"https://api.github.com/users/pustovalov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-09T20:36:41Z","updated_at":"2015-12-09T20:36:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40c51cb58e8e8e76fafdce7c7a3bce5f610a23a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pustovalov/app/pulls/19/commits","review_comments_url":"https://api.github.com/repos/pustovalov/app/pulls/19/comments","review_comment_url":"https://api.github.com/repos/pustovalov/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pustovalov/app/issues/19/comments","statuses_url":"https://api.github.com/repos/pustovalov/app/statuses/a19fd6d672c4a0423e813217b5fcda398b705abd","head":{"label":"pustovalov:supermemo","ref":"supermemo","sha":"a19fd6d672c4a0423e813217b5fcda398b705abd","user":{"login":"pustovalov","id":1568885,"avatar_url":"https://avatars.githubusercontent.com/u/1568885?v=3","gravatar_id":"","url":"https://api.github.com/users/pustovalov","html_url":"https://github.com/pustovalov","followers_url":"https://api.github.com/users/pustovalov/followers","following_url":"https://api.github.com/users/pustovalov/following{/other_user}","gists_url":"https://api.github.com/users/pustovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/pustovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pustovalov/subscriptions","organizations_url":"https://api.github.com/users/pustovalov/orgs","repos_url":"https://api.github.com/users/pustovalov/repos","events_url":"https://api.github.com/users/pustovalov/events{/privacy}","received_events_url":"https://api.github.com/users/pustovalov/received_events","type":"User","site_admin":false},"repo":{"id":43791908,"name":"app","full_name":"pustovalov/app","owner":{"login":"pustovalov","id":1568885,"avatar_url":"https://avatars.githubusercontent.com/u/1568885?v=3","gravatar_id":"","url":"https://api.github.com/users/pustovalov","html_url":"https://github.com/pustovalov","followers_url":"https://api.github.com/users/pustovalov/followers","following_url":"https://api.github.com/users/pustovalov/following{/other_user}","gists_url":"https://api.github.com/users/pustovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/pustovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pustovalov/subscriptions","organizations_url":"https://api.github.com/users/pustovalov/orgs","repos_url":"https://api.github.com/users/pustovalov/repos","events_url":"https://api.github.com/users/pustovalov/events{/privacy}","received_events_url":"https://api.github.com/users/pustovalov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pustovalov/app","description":"Flash cards","fork":false,"url":"https://api.github.com/repos/pustovalov/app","forks_url":"https://api.github.com/repos/pustovalov/app/forks","keys_url":"https://api.github.com/repos/pustovalov/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pustovalov/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pustovalov/app/teams","hooks_url":"https://api.github.com/repos/pustovalov/app/hooks","issue_events_url":"https://api.github.com/repos/pustovalov/app/issues/events{/number}","events_url":"https://api.github.com/repos/pustovalov/app/events","assignees_url":"https://api.github.com/repos/pustovalov/app/assignees{/user}","branches_url":"https://api.github.com/repos/pustovalov/app/branches{/branch}","tags_url":"https://api.github.com/repos/pustovalov/app/tags","blobs_url":"https://api.github.com/repos/pustovalov/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pustovalov/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pustovalov/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/pustovalov/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pustovalov/app/statuses/{sha}","languages_url":"https://api.github.com/repos/pustovalov/app/languages","stargazers_url":"https://api.github.com/repos/pustovalov/app/stargazers","contributors_url":"https://api.github.com/repos/pustovalov/app/contributors","subscribers_url":"https://api.github.com/repos/pustovalov/app/subscribers","subscription_url":"https://api.github.com/repos/pustovalov/app/subscription","commits_url":"https://api.github.com/repos/pustovalov/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/pustovalov/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/pustovalov/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/pustovalov/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/pustovalov/app/contents/{+path}","compare_url":"https://api.github.com/repos/pustovalov/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pustovalov/app/merges","archive_url":"https://api.github.com/repos/pustovalov/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pustovalov/app/downloads","issues_url":"https://api.github.com/repos/pustovalov/app/issues{/number}","pulls_url":"https://api.github.com/repos/pustovalov/app/pulls{/number}","milestones_url":"https://api.github.com/repos/pustovalov/app/milestones{/number}","notifications_url":"https://api.github.com/repos/pustovalov/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pustovalov/app/labels{/name}","releases_url":"https://api.github.com/repos/pustovalov/app/releases{/id}","created_at":"2015-10-07T02:56:29Z","updated_at":"2015-10-29T03:06:34Z","pushed_at":"2015-12-09T20:36:42Z","git_url":"git://github.com/pustovalov/app.git","ssh_url":"git@github.com:pustovalov/app.git","clone_url":"https://github.com/pustovalov/app.git","svn_url":"https://github.com/pustovalov/app","homepage":"http://cards.pustovalov.net","size":321,"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":"pustovalov:master","ref":"master","sha":"c101a6f45e677daf063c389edcf1ab5adf8bbaec","user":{"login":"pustovalov","id":1568885,"avatar_url":"https://avatars.githubusercontent.com/u/1568885?v=3","gravatar_id":"","url":"https://api.github.com/users/pustovalov","html_url":"https://github.com/pustovalov","followers_url":"https://api.github.com/users/pustovalov/followers","following_url":"https://api.github.com/users/pustovalov/following{/other_user}","gists_url":"https://api.github.com/users/pustovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/pustovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pustovalov/subscriptions","organizations_url":"https://api.github.com/users/pustovalov/orgs","repos_url":"https://api.github.com/users/pustovalov/repos","events_url":"https://api.github.com/users/pustovalov/events{/privacy}","received_events_url":"https://api.github.com/users/pustovalov/received_events","type":"User","site_admin":false},"repo":{"id":43791908,"name":"app","full_name":"pustovalov/app","owner":{"login":"pustovalov","id":1568885,"avatar_url":"https://avatars.githubusercontent.com/u/1568885?v=3","gravatar_id":"","url":"https://api.github.com/users/pustovalov","html_url":"https://github.com/pustovalov","followers_url":"https://api.github.com/users/pustovalov/followers","following_url":"https://api.github.com/users/pustovalov/following{/other_user}","gists_url":"https://api.github.com/users/pustovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/pustovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pustovalov/subscriptions","organizations_url":"https://api.github.com/users/pustovalov/orgs","repos_url":"https://api.github.com/users/pustovalov/repos","events_url":"https://api.github.com/users/pustovalov/events{/privacy}","received_events_url":"https://api.github.com/users/pustovalov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pustovalov/app","description":"Flash cards","fork":false,"url":"https://api.github.com/repos/pustovalov/app","forks_url":"https://api.github.com/repos/pustovalov/app/forks","keys_url":"https://api.github.com/repos/pustovalov/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pustovalov/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pustovalov/app/teams","hooks_url":"https://api.github.com/repos/pustovalov/app/hooks","issue_events_url":"https://api.github.com/repos/pustovalov/app/issues/events{/number}","events_url":"https://api.github.com/repos/pustovalov/app/events","assignees_url":"https://api.github.com/repos/pustovalov/app/assignees{/user}","branches_url":"https://api.github.com/repos/pustovalov/app/branches{/branch}","tags_url":"https://api.github.com/repos/pustovalov/app/tags","blobs_url":"https://api.github.com/repos/pustovalov/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pustovalov/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pustovalov/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/pustovalov/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pustovalov/app/statuses/{sha}","languages_url":"https://api.github.com/repos/pustovalov/app/languages","stargazers_url":"https://api.github.com/repos/pustovalov/app/stargazers","contributors_url":"https://api.github.com/repos/pustovalov/app/contributors","subscribers_url":"https://api.github.com/repos/pustovalov/app/subscribers","subscription_url":"https://api.github.com/repos/pustovalov/app/subscription","commits_url":"https://api.github.com/repos/pustovalov/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/pustovalov/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/pustovalov/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/pustovalov/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/pustovalov/app/contents/{+path}","compare_url":"https://api.github.com/repos/pustovalov/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pustovalov/app/merges","archive_url":"https://api.github.com/repos/pustovalov/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pustovalov/app/downloads","issues_url":"https://api.github.com/repos/pustovalov/app/issues{/number}","pulls_url":"https://api.github.com/repos/pustovalov/app/pulls{/number}","milestones_url":"https://api.github.com/repos/pustovalov/app/milestones{/number}","notifications_url":"https://api.github.com/repos/pustovalov/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pustovalov/app/labels{/name}","releases_url":"https://api.github.com/repos/pustovalov/app/releases{/id}","created_at":"2015-10-07T02:56:29Z","updated_at":"2015-10-29T03:06:34Z","pushed_at":"2015-12-09T20:36:42Z","git_url":"git://github.com/pustovalov/app.git","ssh_url":"git@github.com:pustovalov/app.git","clone_url":"https://github.com/pustovalov/app.git","svn_url":"https://github.com/pustovalov/app","homepage":"http://cards.pustovalov.net","size":321,"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/pustovalov/app/pulls/19"},"html":{"href":"https://github.com/pustovalov/app/pull/19"},"issue":{"href":"https://api.github.com/repos/pustovalov/app/issues/19"},"comments":{"href":"https://api.github.com/repos/pustovalov/app/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/pustovalov/app/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/pustovalov/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pustovalov/app/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/pustovalov/app/statuses/a19fd6d672c4a0423e813217b5fcda398b705abd"}}}}