{"action":"created","comment":{"url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/comments/76148924","id":76148924,"diff_hunk":"@@ -0,0 +1,57 @@\n+# Класс Route (Маршрут):\n+#\n+#  Имеет начальную и конечную станцию, а также список\n+#  промежуточных станций. Начальная и конечная станции\n+#  указываются при создании маршрута, а промежуточные\n+#  могут добавляться между ними.\n+#  Может добавлять промежуточную станцию в список\n+#  Может удалять промежуточную станцию из списка\n+#  Может выводить список всех станций по-порядку от\n+#  начальной до конечной\n+#\n+\n+class Route\n+\n+  attr_reader :stations\n+\n+  def initialize(stations)\n+    unless stations.is_a?(Array)\n+      fail( ArgumentError, \n+            \"Route needs Array of Stations to be initialized\")\n+    end\n+\n+    @stations = stations\n+  end\n+\n+  # -  -  -  -  -  -  -  -  -  -  -  - \n+\n+  def first_station()\n+    @stations.first\n+  end\n+  \n+  def last_station()\n+    @stations.last\n+  end\n+\n+  # -  -  -  -  -  -  -  -  -  -  -  -  \n+\n+  def add_station(station)\n+    @stations.insert(-2, station)\n+  end\n+\n+  def remove_station(station)\n+    # don't allow to remove last station and leave route\n+    # without stations\n+    if @stations.size > 1\n+      @stations.delete(station)\n+    end\n+  end\n+\n+  def list_stations()\n+    # return duplicate to prevent @stations change from\n+    # outside of route\n+    @stations.dup","path":"basics-part-3_comments-2/route.rb","position":53,"original_position":53,"commit_id":"82571e25221a5951c36b6f7dbfd9af5690232dbc","original_commit_id":"82571e25221a5951c36b6f7dbfd9af5690232dbc","user":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"body":"Кстати, тут обратная ситуация: если маршрут изменится, поезд об этом не узнает пока ему не дадут новый изменённый маршрут.  Во многом это тоже зависит от контекста задачи.","created_at":"2016-08-24T22:10:36Z","updated_at":"2016-08-24T22:10:36Z","html_url":"https://github.com/VitaliyLazebny/thinknetica/pull/2#discussion_r76148924","pull_request_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/comments/76148924"},"html":{"href":"https://github.com/VitaliyLazebny/thinknetica/pull/2#discussion_r76148924"},"pull_request":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2","id":82625756,"html_url":"https://github.com/VitaliyLazebny/thinknetica/pull/2","diff_url":"https://github.com/VitaliyLazebny/thinknetica/pull/2.diff","patch_url":"https://github.com/VitaliyLazebny/thinknetica/pull/2.patch","issue_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/2","number":2,"state":"open","locked":false,"title":"Add part 3 comments 2","user":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-24T22:05:05Z","updated_at":"2016-08-24T22:10:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f5b9d6ff802df0683265bfef680f6568f3f69e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2/commits","review_comments_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2/comments","review_comment_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/2/comments","statuses_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/statuses/82571e25221a5951c36b6f7dbfd9af5690232dbc","head":{"label":"psylone:master","ref":"master","sha":"82571e25221a5951c36b6f7dbfd9af5690232dbc","user":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"repo":{"id":66502877,"name":"thinknetica","full_name":"psylone/thinknetica","owner":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psylone/thinknetica","description":null,"fork":true,"url":"https://api.github.com/repos/psylone/thinknetica","forks_url":"https://api.github.com/repos/psylone/thinknetica/forks","keys_url":"https://api.github.com/repos/psylone/thinknetica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psylone/thinknetica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psylone/thinknetica/teams","hooks_url":"https://api.github.com/repos/psylone/thinknetica/hooks","issue_events_url":"https://api.github.com/repos/psylone/thinknetica/issues/events{/number}","events_url":"https://api.github.com/repos/psylone/thinknetica/events","assignees_url":"https://api.github.com/repos/psylone/thinknetica/assignees{/user}","branches_url":"https://api.github.com/repos/psylone/thinknetica/branches{/branch}","tags_url":"https://api.github.com/repos/psylone/thinknetica/tags","blobs_url":"https://api.github.com/repos/psylone/thinknetica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psylone/thinknetica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psylone/thinknetica/git/refs{/sha}","trees_url":"https://api.github.com/repos/psylone/thinknetica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psylone/thinknetica/statuses/{sha}","languages_url":"https://api.github.com/repos/psylone/thinknetica/languages","stargazers_url":"https://api.github.com/repos/psylone/thinknetica/stargazers","contributors_url":"https://api.github.com/repos/psylone/thinknetica/contributors","subscribers_url":"https://api.github.com/repos/psylone/thinknetica/subscribers","subscription_url":"https://api.github.com/repos/psylone/thinknetica/subscription","commits_url":"https://api.github.com/repos/psylone/thinknetica/commits{/sha}","git_commits_url":"https://api.github.com/repos/psylone/thinknetica/git/commits{/sha}","comments_url":"https://api.github.com/repos/psylone/thinknetica/comments{/number}","issue_comment_url":"https://api.github.com/repos/psylone/thinknetica/issues/comments{/number}","contents_url":"https://api.github.com/repos/psylone/thinknetica/contents/{+path}","compare_url":"https://api.github.com/repos/psylone/thinknetica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psylone/thinknetica/merges","archive_url":"https://api.github.com/repos/psylone/thinknetica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psylone/thinknetica/downloads","issues_url":"https://api.github.com/repos/psylone/thinknetica/issues{/number}","pulls_url":"https://api.github.com/repos/psylone/thinknetica/pulls{/number}","milestones_url":"https://api.github.com/repos/psylone/thinknetica/milestones{/number}","notifications_url":"https://api.github.com/repos/psylone/thinknetica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psylone/thinknetica/labels{/name}","releases_url":"https://api.github.com/repos/psylone/thinknetica/releases{/id}","deployments_url":"https://api.github.com/repos/psylone/thinknetica/deployments","created_at":"2016-08-24T21:59:58Z","updated_at":"2016-08-24T22:00:00Z","pushed_at":"2016-08-24T22:04:56Z","git_url":"git://github.com/psylone/thinknetica.git","ssh_url":"git@github.com:psylone/thinknetica.git","clone_url":"https://github.com/psylone/thinknetica.git","svn_url":"https://github.com/psylone/thinknetica","homepage":null,"size":20,"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":"VitaliyLazebny:master","ref":"master","sha":"366c7cc26f784211cd0032baf74eb666b82f2936","user":{"login":"VitaliyLazebny","id":18521734,"avatar_url":"https://avatars.githubusercontent.com/u/18521734?v=3","gravatar_id":"","url":"https://api.github.com/users/VitaliyLazebny","html_url":"https://github.com/VitaliyLazebny","followers_url":"https://api.github.com/users/VitaliyLazebny/followers","following_url":"https://api.github.com/users/VitaliyLazebny/following{/other_user}","gists_url":"https://api.github.com/users/VitaliyLazebny/gists{/gist_id}","starred_url":"https://api.github.com/users/VitaliyLazebny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VitaliyLazebny/subscriptions","organizations_url":"https://api.github.com/users/VitaliyLazebny/orgs","repos_url":"https://api.github.com/users/VitaliyLazebny/repos","events_url":"https://api.github.com/users/VitaliyLazebny/events{/privacy}","received_events_url":"https://api.github.com/users/VitaliyLazebny/received_events","type":"User","site_admin":false},"repo":{"id":65421406,"name":"thinknetica","full_name":"VitaliyLazebny/thinknetica","owner":{"login":"VitaliyLazebny","id":18521734,"avatar_url":"https://avatars.githubusercontent.com/u/18521734?v=3","gravatar_id":"","url":"https://api.github.com/users/VitaliyLazebny","html_url":"https://github.com/VitaliyLazebny","followers_url":"https://api.github.com/users/VitaliyLazebny/followers","following_url":"https://api.github.com/users/VitaliyLazebny/following{/other_user}","gists_url":"https://api.github.com/users/VitaliyLazebny/gists{/gist_id}","starred_url":"https://api.github.com/users/VitaliyLazebny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VitaliyLazebny/subscriptions","organizations_url":"https://api.github.com/users/VitaliyLazebny/orgs","repos_url":"https://api.github.com/users/VitaliyLazebny/repos","events_url":"https://api.github.com/users/VitaliyLazebny/events{/privacy}","received_events_url":"https://api.github.com/users/VitaliyLazebny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VitaliyLazebny/thinknetica","description":null,"fork":false,"url":"https://api.github.com/repos/VitaliyLazebny/thinknetica","forks_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/forks","keys_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/teams","hooks_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/hooks","issue_events_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/events{/number}","events_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/events","assignees_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/assignees{/user}","branches_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/branches{/branch}","tags_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/tags","blobs_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/git/refs{/sha}","trees_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/statuses/{sha}","languages_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/languages","stargazers_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/stargazers","contributors_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/contributors","subscribers_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/subscribers","subscription_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/subscription","commits_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/commits{/sha}","git_commits_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/git/commits{/sha}","comments_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/comments{/number}","issue_comment_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/comments{/number}","contents_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/contents/{+path}","compare_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/merges","archive_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/downloads","issues_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues{/number}","pulls_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls{/number}","milestones_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/milestones{/number}","notifications_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/labels{/name}","releases_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/releases{/id}","deployments_url":"https://api.github.com/repos/VitaliyLazebny/thinknetica/deployments","created_at":"2016-08-10T22:46:34Z","updated_at":"2016-08-11T19:39:50Z","pushed_at":"2016-08-24T22:05:05Z","git_url":"git://github.com/VitaliyLazebny/thinknetica.git","ssh_url":"git@github.com:VitaliyLazebny/thinknetica.git","clone_url":"https://github.com/VitaliyLazebny/thinknetica.git","svn_url":"https://github.com/VitaliyLazebny/thinknetica","homepage":null,"size":20,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2"},"html":{"href":"https://github.com/VitaliyLazebny/thinknetica/pull/2"},"issue":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/2"},"comments":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/VitaliyLazebny/thinknetica/statuses/82571e25221a5951c36b6f7dbfd9af5690232dbc"}}}}
{"actor":{"display_login":"psylone"}}