{"action":"created","comment":{"url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/comments/148116374","pull_request_review_id":73311302,"id":148116374,"diff_hunk":"@@ -0,0 +1,38 @@\n+module Accessors\n+  def attr_accessor_with_history(*args)\n+    args.each do |arg|\n+      define_method(arg) do\n+        instance_variable_get(\"@#{arg}\")\n+      end\n+\n+      define_method(\"#{arg}=\") do |var|\n+        instance_variable_set(\"@#{arg}\", var)\n+        instance_variable_set(\"@#{arg}_history\", send(\"#{arg}_history\") << var)\n+      end\n+\n+      define_method(\"#{arg}_history\") do\n+        if instance_variable_defined?(\"@#{arg}_history\")\n+          instance_variable_get(\"@#{arg}_history\")\n+        else\n+          instance_variable_set(\"@#{arg}_history\", [])","path":"Lesson10/accessors.rb","position":null,"original_position":17,"commit_id":"2ce4e46172845a909bcdfd5028a08fcc43c9f414","original_commit_id":"20851cbd32781cbb4228ad81ee80770edeb9f633","user":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"body":"Не согласен. Я ведь в 10 строке, прсваивая значение переменной @#{arg}_history, вызываю метод #{arg}_history, внутри которого и происходит инициализация. Поэтому вне зависимости от порядка вызова истории или сеттера, код будет работать. Или проблема в том, что такая \"инициализация\" проходит в неявном виде?","created_at":"2017-10-31T20:22:14Z","updated_at":"2017-10-31T20:22:15Z","html_url":"https://github.com/mfoxtrot/thinknetica_course/pull/1#discussion_r148116374","pull_request_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/comments/148116374"},"html":{"href":"https://github.com/mfoxtrot/thinknetica_course/pull/1#discussion_r148116374"},"pull_request":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1"}},"in_reply_to_id":147771683},"pull_request":{"url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1","id":149516678,"html_url":"https://github.com/mfoxtrot/thinknetica_course/pull/1","diff_url":"https://github.com/mfoxtrot/thinknetica_course/pull/1.diff","patch_url":"https://github.com/mfoxtrot/thinknetica_course/pull/1.patch","issue_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/1","number":1,"state":"open","locked":false,"title":"Lesson10","user":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-30T13:05:15Z","updated_at":"2017-10-31T20:22:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f213feabaeea07248f3e589f476547eda1e49df0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/1/comments","statuses_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/statuses/2ce4e46172845a909bcdfd5028a08fcc43c9f414","head":{"label":"mfoxtrot:Lesson10","ref":"Lesson10","sha":"2ce4e46172845a909bcdfd5028a08fcc43c9f414","user":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"repo":{"id":105443792,"name":"thinknetica_course","full_name":"mfoxtrot/thinknetica_course","owner":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfoxtrot/thinknetica_course","description":"RoR Thinknetica Course","fork":false,"url":"https://api.github.com/repos/mfoxtrot/thinknetica_course","forks_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/forks","keys_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/teams","hooks_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/hooks","issue_events_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/events{/number}","events_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/events","assignees_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/assignees{/user}","branches_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/branches{/branch}","tags_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/tags","blobs_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/statuses/{sha}","languages_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/languages","stargazers_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/stargazers","contributors_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/contributors","subscribers_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/subscribers","subscription_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/subscription","commits_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/contents/{+path}","compare_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/merges","archive_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/downloads","issues_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues{/number}","pulls_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls{/number}","milestones_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/milestones{/number}","notifications_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/labels{/name}","releases_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/releases{/id}","deployments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/deployments","created_at":"2017-10-01T13:24:03Z","updated_at":"2017-10-04T04:33:42Z","pushed_at":"2017-10-31T08:50:42Z","git_url":"git://github.com/mfoxtrot/thinknetica_course.git","ssh_url":"git@github.com:mfoxtrot/thinknetica_course.git","clone_url":"https://github.com/mfoxtrot/thinknetica_course.git","svn_url":"https://github.com/mfoxtrot/thinknetica_course","homepage":null,"size":29,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mfoxtrot:master","ref":"master","sha":"15f03e470990bca84ff8fab57225a24397a9309e","user":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"repo":{"id":105443792,"name":"thinknetica_course","full_name":"mfoxtrot/thinknetica_course","owner":{"login":"mfoxtrot","id":5728951,"avatar_url":"https://avatars3.githubusercontent.com/u/5728951?v=4","gravatar_id":"","url":"https://api.github.com/users/mfoxtrot","html_url":"https://github.com/mfoxtrot","followers_url":"https://api.github.com/users/mfoxtrot/followers","following_url":"https://api.github.com/users/mfoxtrot/following{/other_user}","gists_url":"https://api.github.com/users/mfoxtrot/gists{/gist_id}","starred_url":"https://api.github.com/users/mfoxtrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfoxtrot/subscriptions","organizations_url":"https://api.github.com/users/mfoxtrot/orgs","repos_url":"https://api.github.com/users/mfoxtrot/repos","events_url":"https://api.github.com/users/mfoxtrot/events{/privacy}","received_events_url":"https://api.github.com/users/mfoxtrot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfoxtrot/thinknetica_course","description":"RoR Thinknetica Course","fork":false,"url":"https://api.github.com/repos/mfoxtrot/thinknetica_course","forks_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/forks","keys_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/teams","hooks_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/hooks","issue_events_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/events{/number}","events_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/events","assignees_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/assignees{/user}","branches_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/branches{/branch}","tags_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/tags","blobs_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/statuses/{sha}","languages_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/languages","stargazers_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/stargazers","contributors_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/contributors","subscribers_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/subscribers","subscription_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/subscription","commits_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/contents/{+path}","compare_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/merges","archive_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/downloads","issues_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues{/number}","pulls_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls{/number}","milestones_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/milestones{/number}","notifications_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/labels{/name}","releases_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/releases{/id}","deployments_url":"https://api.github.com/repos/mfoxtrot/thinknetica_course/deployments","created_at":"2017-10-01T13:24:03Z","updated_at":"2017-10-04T04:33:42Z","pushed_at":"2017-10-31T08:50:42Z","git_url":"git://github.com/mfoxtrot/thinknetica_course.git","ssh_url":"git@github.com:mfoxtrot/thinknetica_course.git","clone_url":"https://github.com/mfoxtrot/thinknetica_course.git","svn_url":"https://github.com/mfoxtrot/thinknetica_course","homepage":null,"size":29,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1"},"html":{"href":"https://github.com/mfoxtrot/thinknetica_course/pull/1"},"issue":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/1"},"comments":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mfoxtrot/thinknetica_course/statuses/2ce4e46172845a909bcdfd5028a08fcc43c9f414"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mfoxtrot"}}