{"action":"created","comment":{"url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/comments/234399546","pull_request_review_id":176044239,"id":234399546,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDM5OTU0Ng==","diff_hunk":"@@ -0,0 +1,46 @@\n+module CalculatorOfRent\n+\n+  class Calculator\n+\n+    def initialize(start_time, end_time, model)\n+      @start_time = start_time.to_time\n+      @end_time = end_time.to_time\n+      @model = model\n+      @start_time_day = start_time.to_date\n+      @end_time_day = end_time.to_date\n+    end\n+\n+    NUMBER_OF_WORK_DAYS_OF_WEEK = 5\n+    NUMBER_OF_WEEKEND_DAYS = 2\n+\n+    def model_cost\n+      @cost1 = 1000\n+      @cost2 = 900\n+      @cost3 = 800\n+      @costworkday = 4500\n+      @costweekend = 1800\n+    end\n+\n+    def logic_calculator\n+      @rent_days = ((@end_time - @start_time)/1.day).to_i + 1","path":"lib/calculator_of_rent/calculator.rb","position":25,"original_position":25,"commit_id":"bfb3b0858ca90f8ffac3126c035fb841c3b781d3","original_commit_id":"bfb3b0858ca90f8ffac3126c035fb841c3b781d3","user":{"login":"igorsimdyanov","id":2901012,"node_id":"MDQ6VXNlcjI5MDEwMTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2901012?v=4","gravatar_id":"","url":"https://api.github.com/users/igorsimdyanov","html_url":"https://github.com/igorsimdyanov","followers_url":"https://api.github.com/users/igorsimdyanov/followers","following_url":"https://api.github.com/users/igorsimdyanov/following{/other_user}","gists_url":"https://api.github.com/users/igorsimdyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/igorsimdyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorsimdyanov/subscriptions","organizations_url":"https://api.github.com/users/igorsimdyanov/orgs","repos_url":"https://api.github.com/users/igorsimdyanov/repos","events_url":"https://api.github.com/users/igorsimdyanov/events{/privacy}","received_events_url":"https://api.github.com/users/igorsimdyanov/received_events","type":"User","site_admin":false},"body":"Очень сложный метод с большим количеством вложений, нужно дальше дробить логику","created_at":"2018-11-17T07:10:12Z","updated_at":"2018-11-17T07:15:17Z","html_url":"https://github.com/Yaroslavzev/rent_auto-back/pull/2#discussion_r234399546","pull_request_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/comments/234399546"},"html":{"href":"https://github.com/Yaroslavzev/rent_auto-back/pull/2#discussion_r234399546"},"pull_request":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2","id":231711874,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzExODc0","html_url":"https://github.com/Yaroslavzev/rent_auto-back/pull/2","diff_url":"https://github.com/Yaroslavzev/rent_auto-back/pull/2.diff","patch_url":"https://github.com/Yaroslavzev/rent_auto-back/pull/2.patch","issue_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/2","number":2,"state":"open","locked":false,"title":"Added class for rent value calculation","user":{"login":"Yaroslavzev","id":32732655,"node_id":"MDQ6VXNlcjMyNzMyNjU1","avatar_url":"https://avatars1.githubusercontent.com/u/32732655?v=4","gravatar_id":"","url":"https://api.github.com/users/Yaroslavzev","html_url":"https://github.com/Yaroslavzev","followers_url":"https://api.github.com/users/Yaroslavzev/followers","following_url":"https://api.github.com/users/Yaroslavzev/following{/other_user}","gists_url":"https://api.github.com/users/Yaroslavzev/gists{/gist_id}","starred_url":"https://api.github.com/users/Yaroslavzev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yaroslavzev/subscriptions","organizations_url":"https://api.github.com/users/Yaroslavzev/orgs","repos_url":"https://api.github.com/users/Yaroslavzev/repos","events_url":"https://api.github.com/users/Yaroslavzev/events{/privacy}","received_events_url":"https://api.github.com/users/Yaroslavzev/received_events","type":"User","site_admin":false},"body":"@igorsimdyanov сделал в отдельном контроллере с отличным названием от класса.\r\nНе могли бы дать комментарии?\r\nспасибо","created_at":"2018-11-17T07:06:37Z","updated_at":"2018-11-17T07:15:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0b24a8a17a817d391b250ab7acb50705ef887e2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/2/comments","statuses_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/statuses/bfb3b0858ca90f8ffac3126c035fb841c3b781d3","head":{"label":"Yaroslavzev:cost_calculation","ref":"cost_calculation","sha":"bfb3b0858ca90f8ffac3126c035fb841c3b781d3","user":{"login":"Yaroslavzev","id":32732655,"node_id":"MDQ6VXNlcjMyNzMyNjU1","avatar_url":"https://avatars1.githubusercontent.com/u/32732655?v=4","gravatar_id":"","url":"https://api.github.com/users/Yaroslavzev","html_url":"https://github.com/Yaroslavzev","followers_url":"https://api.github.com/users/Yaroslavzev/followers","following_url":"https://api.github.com/users/Yaroslavzev/following{/other_user}","gists_url":"https://api.github.com/users/Yaroslavzev/gists{/gist_id}","starred_url":"https://api.github.com/users/Yaroslavzev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yaroslavzev/subscriptions","organizations_url":"https://api.github.com/users/Yaroslavzev/orgs","repos_url":"https://api.github.com/users/Yaroslavzev/repos","events_url":"https://api.github.com/users/Yaroslavzev/events{/privacy}","received_events_url":"https://api.github.com/users/Yaroslavzev/received_events","type":"User","site_admin":false},"repo":{"id":156199494,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYxOTk0OTQ=","name":"rent_auto-back","full_name":"Yaroslavzev/rent_auto-back","private":false,"owner":{"login":"Yaroslavzev","id":32732655,"node_id":"MDQ6VXNlcjMyNzMyNjU1","avatar_url":"https://avatars1.githubusercontent.com/u/32732655?v=4","gravatar_id":"","url":"https://api.github.com/users/Yaroslavzev","html_url":"https://github.com/Yaroslavzev","followers_url":"https://api.github.com/users/Yaroslavzev/followers","following_url":"https://api.github.com/users/Yaroslavzev/following{/other_user}","gists_url":"https://api.github.com/users/Yaroslavzev/gists{/gist_id}","starred_url":"https://api.github.com/users/Yaroslavzev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yaroslavzev/subscriptions","organizations_url":"https://api.github.com/users/Yaroslavzev/orgs","repos_url":"https://api.github.com/users/Yaroslavzev/repos","events_url":"https://api.github.com/users/Yaroslavzev/events{/privacy}","received_events_url":"https://api.github.com/users/Yaroslavzev/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Yaroslavzev/rent_auto-back","description":"RoR Rent Auto Back","fork":true,"url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back","forks_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/forks","keys_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/teams","hooks_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/hooks","issue_events_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/events{/number}","events_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/events","assignees_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/assignees{/user}","branches_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/branches{/branch}","tags_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/tags","blobs_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/statuses/{sha}","languages_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/languages","stargazers_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/stargazers","contributors_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/contributors","subscribers_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/subscribers","subscription_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/subscription","commits_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/contents/{+path}","compare_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/merges","archive_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/downloads","issues_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues{/number}","pulls_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls{/number}","milestones_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/milestones{/number}","notifications_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/labels{/name}","releases_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/releases{/id}","deployments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/deployments","created_at":"2018-11-05T10:26:33Z","updated_at":"2018-11-09T08:56:10Z","pushed_at":"2018-11-17T07:06:38Z","git_url":"git://github.com/Yaroslavzev/rent_auto-back.git","ssh_url":"git@github.com:Yaroslavzev/rent_auto-back.git","clone_url":"https://github.com/Yaroslavzev/rent_auto-back.git","svn_url":"https://github.com/Yaroslavzev/rent_auto-back","homepage":null,"size":236,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Yaroslavzev:develop","ref":"develop","sha":"031b7ab84f1169e1d1d190b835a3014d821214b3","user":{"login":"Yaroslavzev","id":32732655,"node_id":"MDQ6VXNlcjMyNzMyNjU1","avatar_url":"https://avatars1.githubusercontent.com/u/32732655?v=4","gravatar_id":"","url":"https://api.github.com/users/Yaroslavzev","html_url":"https://github.com/Yaroslavzev","followers_url":"https://api.github.com/users/Yaroslavzev/followers","following_url":"https://api.github.com/users/Yaroslavzev/following{/other_user}","gists_url":"https://api.github.com/users/Yaroslavzev/gists{/gist_id}","starred_url":"https://api.github.com/users/Yaroslavzev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yaroslavzev/subscriptions","organizations_url":"https://api.github.com/users/Yaroslavzev/orgs","repos_url":"https://api.github.com/users/Yaroslavzev/repos","events_url":"https://api.github.com/users/Yaroslavzev/events{/privacy}","received_events_url":"https://api.github.com/users/Yaroslavzev/received_events","type":"User","site_admin":false},"repo":{"id":156199494,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYxOTk0OTQ=","name":"rent_auto-back","full_name":"Yaroslavzev/rent_auto-back","private":false,"owner":{"login":"Yaroslavzev","id":32732655,"node_id":"MDQ6VXNlcjMyNzMyNjU1","avatar_url":"https://avatars1.githubusercontent.com/u/32732655?v=4","gravatar_id":"","url":"https://api.github.com/users/Yaroslavzev","html_url":"https://github.com/Yaroslavzev","followers_url":"https://api.github.com/users/Yaroslavzev/followers","following_url":"https://api.github.com/users/Yaroslavzev/following{/other_user}","gists_url":"https://api.github.com/users/Yaroslavzev/gists{/gist_id}","starred_url":"https://api.github.com/users/Yaroslavzev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yaroslavzev/subscriptions","organizations_url":"https://api.github.com/users/Yaroslavzev/orgs","repos_url":"https://api.github.com/users/Yaroslavzev/repos","events_url":"https://api.github.com/users/Yaroslavzev/events{/privacy}","received_events_url":"https://api.github.com/users/Yaroslavzev/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Yaroslavzev/rent_auto-back","description":"RoR Rent Auto Back","fork":true,"url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back","forks_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/forks","keys_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/teams","hooks_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/hooks","issue_events_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/events{/number}","events_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/events","assignees_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/assignees{/user}","branches_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/branches{/branch}","tags_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/tags","blobs_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/statuses/{sha}","languages_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/languages","stargazers_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/stargazers","contributors_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/contributors","subscribers_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/subscribers","subscription_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/subscription","commits_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/contents/{+path}","compare_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/merges","archive_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/downloads","issues_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues{/number}","pulls_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls{/number}","milestones_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/milestones{/number}","notifications_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/labels{/name}","releases_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/releases{/id}","deployments_url":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/deployments","created_at":"2018-11-05T10:26:33Z","updated_at":"2018-11-09T08:56:10Z","pushed_at":"2018-11-17T07:06:38Z","git_url":"git://github.com/Yaroslavzev/rent_auto-back.git","ssh_url":"git@github.com:Yaroslavzev/rent_auto-back.git","clone_url":"https://github.com/Yaroslavzev/rent_auto-back.git","svn_url":"https://github.com/Yaroslavzev/rent_auto-back","homepage":null,"size":236,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2"},"html":{"href":"https://github.com/Yaroslavzev/rent_auto-back/pull/2"},"issue":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/2"},"comments":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Yaroslavzev/rent_auto-back/statuses/bfb3b0858ca90f8ffac3126c035fb841c3b781d3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"igorsimdyanov"}}