{"action":"created","comment":{"url":"https://api.github.com/repos/evg-tray/tn/pulls/comments/88302978","pull_request_review_id":8880713,"id":88302978,"diff_hunk":"@@ -97,8 +100,7 @@ def self.type\n   end\n \n   def self.find(number)\n-    trains = @@trains.select { |train| train.number == number }\n-    trains[0] if trains.count > 0\n+    @@trains.detect { |train| train.number == number }","path":"Lesson3/models/train.rb","position":null,"original_position":16,"commit_id":"0bf3ab9c5fab5c977acf13bfcea2b59735382567","original_commit_id":"d881d6cc6f09a20d6463268da95b8efefb5e745e","user":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"body":"Типы поездов реализованы дочерними классами, думаю излишне добавлять еще типы, характеризующие теже самые типы. В случае добавления нового типа нужно будет править класс `Train`, а так достаточно просто создать унаследованный от него класс.","created_at":"2016-11-16T18:46:57Z","updated_at":"2016-11-16T18:46:57Z","html_url":"https://github.com/evg-tray/tn/pull/2#discussion_r88302978","pull_request_url":"https://api.github.com/repos/evg-tray/tn/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/comments/88302978"},"html":{"href":"https://github.com/evg-tray/tn/pull/2#discussion_r88302978"},"pull_request":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/evg-tray/tn/pulls/2","id":93629425,"html_url":"https://github.com/evg-tray/tn/pull/2","diff_url":"https://github.com/evg-tray/tn/pull/2.diff","patch_url":"https://github.com/evg-tray/tn/pull/2.patch","issue_url":"https://api.github.com/repos/evg-tray/tn/issues/2","number":2,"state":"open","locked":false,"title":"Lesson 5","user":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-14T19:20:52Z","updated_at":"2016-11-16T18:46:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8535996bd6febffb5d81de0b12ca463f5b574f9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/evg-tray/tn/pulls/2/commits","review_comments_url":"https://api.github.com/repos/evg-tray/tn/pulls/2/comments","review_comment_url":"https://api.github.com/repos/evg-tray/tn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/evg-tray/tn/issues/2/comments","statuses_url":"https://api.github.com/repos/evg-tray/tn/statuses/0bf3ab9c5fab5c977acf13bfcea2b59735382567","head":{"label":"evg-tray:methods","ref":"methods","sha":"0bf3ab9c5fab5c977acf13bfcea2b59735382567","user":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"repo":{"id":73086555,"name":"tn","full_name":"evg-tray/tn","owner":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evg-tray/tn","description":null,"fork":false,"url":"https://api.github.com/repos/evg-tray/tn","forks_url":"https://api.github.com/repos/evg-tray/tn/forks","keys_url":"https://api.github.com/repos/evg-tray/tn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evg-tray/tn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evg-tray/tn/teams","hooks_url":"https://api.github.com/repos/evg-tray/tn/hooks","issue_events_url":"https://api.github.com/repos/evg-tray/tn/issues/events{/number}","events_url":"https://api.github.com/repos/evg-tray/tn/events","assignees_url":"https://api.github.com/repos/evg-tray/tn/assignees{/user}","branches_url":"https://api.github.com/repos/evg-tray/tn/branches{/branch}","tags_url":"https://api.github.com/repos/evg-tray/tn/tags","blobs_url":"https://api.github.com/repos/evg-tray/tn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evg-tray/tn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evg-tray/tn/git/refs{/sha}","trees_url":"https://api.github.com/repos/evg-tray/tn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evg-tray/tn/statuses/{sha}","languages_url":"https://api.github.com/repos/evg-tray/tn/languages","stargazers_url":"https://api.github.com/repos/evg-tray/tn/stargazers","contributors_url":"https://api.github.com/repos/evg-tray/tn/contributors","subscribers_url":"https://api.github.com/repos/evg-tray/tn/subscribers","subscription_url":"https://api.github.com/repos/evg-tray/tn/subscription","commits_url":"https://api.github.com/repos/evg-tray/tn/commits{/sha}","git_commits_url":"https://api.github.com/repos/evg-tray/tn/git/commits{/sha}","comments_url":"https://api.github.com/repos/evg-tray/tn/comments{/number}","issue_comment_url":"https://api.github.com/repos/evg-tray/tn/issues/comments{/number}","contents_url":"https://api.github.com/repos/evg-tray/tn/contents/{+path}","compare_url":"https://api.github.com/repos/evg-tray/tn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evg-tray/tn/merges","archive_url":"https://api.github.com/repos/evg-tray/tn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evg-tray/tn/downloads","issues_url":"https://api.github.com/repos/evg-tray/tn/issues{/number}","pulls_url":"https://api.github.com/repos/evg-tray/tn/pulls{/number}","milestones_url":"https://api.github.com/repos/evg-tray/tn/milestones{/number}","notifications_url":"https://api.github.com/repos/evg-tray/tn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evg-tray/tn/labels{/name}","releases_url":"https://api.github.com/repos/evg-tray/tn/releases{/id}","deployments_url":"https://api.github.com/repos/evg-tray/tn/deployments","created_at":"2016-11-07T14:31:04Z","updated_at":"2016-11-07T20:40:03Z","pushed_at":"2016-11-16T11:10:36Z","git_url":"git://github.com/evg-tray/tn.git","ssh_url":"git@github.com:evg-tray/tn.git","clone_url":"https://github.com/evg-tray/tn.git","svn_url":"https://github.com/evg-tray/tn","homepage":null,"size":18,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"evg-tray:master","ref":"master","sha":"bef10424796763f3d0e040efb59e7388f00bf236","user":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"repo":{"id":73086555,"name":"tn","full_name":"evg-tray/tn","owner":{"login":"evg-tray","id":23312747,"avatar_url":"https://avatars.githubusercontent.com/u/23312747?v=3","gravatar_id":"","url":"https://api.github.com/users/evg-tray","html_url":"https://github.com/evg-tray","followers_url":"https://api.github.com/users/evg-tray/followers","following_url":"https://api.github.com/users/evg-tray/following{/other_user}","gists_url":"https://api.github.com/users/evg-tray/gists{/gist_id}","starred_url":"https://api.github.com/users/evg-tray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evg-tray/subscriptions","organizations_url":"https://api.github.com/users/evg-tray/orgs","repos_url":"https://api.github.com/users/evg-tray/repos","events_url":"https://api.github.com/users/evg-tray/events{/privacy}","received_events_url":"https://api.github.com/users/evg-tray/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evg-tray/tn","description":null,"fork":false,"url":"https://api.github.com/repos/evg-tray/tn","forks_url":"https://api.github.com/repos/evg-tray/tn/forks","keys_url":"https://api.github.com/repos/evg-tray/tn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evg-tray/tn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evg-tray/tn/teams","hooks_url":"https://api.github.com/repos/evg-tray/tn/hooks","issue_events_url":"https://api.github.com/repos/evg-tray/tn/issues/events{/number}","events_url":"https://api.github.com/repos/evg-tray/tn/events","assignees_url":"https://api.github.com/repos/evg-tray/tn/assignees{/user}","branches_url":"https://api.github.com/repos/evg-tray/tn/branches{/branch}","tags_url":"https://api.github.com/repos/evg-tray/tn/tags","blobs_url":"https://api.github.com/repos/evg-tray/tn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evg-tray/tn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evg-tray/tn/git/refs{/sha}","trees_url":"https://api.github.com/repos/evg-tray/tn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evg-tray/tn/statuses/{sha}","languages_url":"https://api.github.com/repos/evg-tray/tn/languages","stargazers_url":"https://api.github.com/repos/evg-tray/tn/stargazers","contributors_url":"https://api.github.com/repos/evg-tray/tn/contributors","subscribers_url":"https://api.github.com/repos/evg-tray/tn/subscribers","subscription_url":"https://api.github.com/repos/evg-tray/tn/subscription","commits_url":"https://api.github.com/repos/evg-tray/tn/commits{/sha}","git_commits_url":"https://api.github.com/repos/evg-tray/tn/git/commits{/sha}","comments_url":"https://api.github.com/repos/evg-tray/tn/comments{/number}","issue_comment_url":"https://api.github.com/repos/evg-tray/tn/issues/comments{/number}","contents_url":"https://api.github.com/repos/evg-tray/tn/contents/{+path}","compare_url":"https://api.github.com/repos/evg-tray/tn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evg-tray/tn/merges","archive_url":"https://api.github.com/repos/evg-tray/tn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evg-tray/tn/downloads","issues_url":"https://api.github.com/repos/evg-tray/tn/issues{/number}","pulls_url":"https://api.github.com/repos/evg-tray/tn/pulls{/number}","milestones_url":"https://api.github.com/repos/evg-tray/tn/milestones{/number}","notifications_url":"https://api.github.com/repos/evg-tray/tn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evg-tray/tn/labels{/name}","releases_url":"https://api.github.com/repos/evg-tray/tn/releases{/id}","deployments_url":"https://api.github.com/repos/evg-tray/tn/deployments","created_at":"2016-11-07T14:31:04Z","updated_at":"2016-11-07T20:40:03Z","pushed_at":"2016-11-16T11:10:36Z","git_url":"git://github.com/evg-tray/tn.git","ssh_url":"git@github.com:evg-tray/tn.git","clone_url":"https://github.com/evg-tray/tn.git","svn_url":"https://github.com/evg-tray/tn","homepage":null,"size":18,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/2"},"html":{"href":"https://github.com/evg-tray/tn/pull/2"},"issue":{"href":"https://api.github.com/repos/evg-tray/tn/issues/2"},"comments":{"href":"https://api.github.com/repos/evg-tray/tn/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/evg-tray/tn/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/evg-tray/tn/statuses/0bf3ab9c5fab5c977acf13bfcea2b59735382567"}}}}
{"actor":{"display_login":"evg-tray"}}