{"action":"created","comment":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/144654253","pull_request_review_id":69347305,"id":144654253,"diff_hunk":"@@ -0,0 +1,104 @@\n+class Node\n+  attr_accessor :data, :left, :right\n+\n+  def initialize(x = nil)\n+    @data = x\n+    @left = nil\n+    @right = nil\n+  end\n+\n+  def grow_tree(array)\n+    self.data = array[0]\n+    subtree = array[1]\n+    if subtree[0].class == nil.class\n+      return\n+    elsif subtree[0].class == array.class\n+      @left = Node.new.grow_tree(subtree[0])\n+    else\n+      @left = Node.new(subtree[0])\n+    end\n+    if subtree[1].class == nil.class\n+      return\n+    elsif subtree[1].class == array.class\n+      @right = Node.new.grow_tree(subtree[1])\n+    else\n+      @right = Node.new(subtree[1])\n+    end\n+    return self\n+  end\n+\n+\n+\n+\n+  def tree_to_array(lvl:, depth:0, array:)\n+    spaces = get_spaces(lvl)\n+    string = spaces + @data.to_s + spaces\n+    array[lvl-1] += string\n+    if @left.class == nil.class && @right.class == nil.class\n+      return\n+    else\n+      left_lvl = @left.get_tree_lvl\n+      @left.tree_to_array(lvl:left_lvl, depth:left_lvl, array:array)\n+      right_lvl = @right.get_tree_lvl\n+      @right.tree_to_array(lvl:right_lvl, depth:left_lvl, array:array)\n+    end \n+    array \n+  end\n+\n+  def get_tree_lvl(lvl = 0)\n+    lvl += 1\n+    if @left.class == nil.class\n+      return lvl\n+    else\n+      @left.get_tree_lvl(lvl)\n+    end\n+  end\n+\n+  def get_spaces(lvl)\n+    return '  ' * lvl \n+  end\n+\n+  def show_tree\n+    tree_lvl = self.get_tree_lvl\n+    a = Array.new(tree_lvl,'')\n+    a = self.tree_to_array(lvl:tree_lvl,depth:tree_lvl ,array:a)\n+    a.each do |element|\n+    printf element\n+    printf \"\\n\"\n+    end\n+  end\n+end\n+\n+if ENV['NAME'] == nil","path":"2017/EvgeniyBakunovich/1/tree.rb","position":72,"original_position":72,"commit_id":"5e9901e8c487de6b89ad7a3de473932add3270e8","original_commit_id":"5e9901e8c487de6b89ad7a3de473932add3270e8","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Prefer the use of the nil? predicate.","created_at":"2017-10-13T20:50:31Z","updated_at":"2017-10-13T20:50:32Z","html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/587#discussion_r144654253","pull_request_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/144654253"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/587#discussion_r144654253"},"pull_request":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587"}}},"pull_request":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587","id":146551708,"html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/587","diff_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/587.diff","patch_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/587.patch","issue_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/587","number":587,"state":"open","locked":false,"title":"implement hw 1","user":{"login":"EvgeniyBakunovich","id":32778500,"avatar_url":"https://avatars3.githubusercontent.com/u/32778500?v=4","gravatar_id":"","url":"https://api.github.com/users/EvgeniyBakunovich","html_url":"https://github.com/EvgeniyBakunovich","followers_url":"https://api.github.com/users/EvgeniyBakunovich/followers","following_url":"https://api.github.com/users/EvgeniyBakunovich/following{/other_user}","gists_url":"https://api.github.com/users/EvgeniyBakunovich/gists{/gist_id}","starred_url":"https://api.github.com/users/EvgeniyBakunovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvgeniyBakunovich/subscriptions","organizations_url":"https://api.github.com/users/EvgeniyBakunovich/orgs","repos_url":"https://api.github.com/users/EvgeniyBakunovich/repos","events_url":"https://api.github.com/users/EvgeniyBakunovich/events{/privacy}","received_events_url":"https://api.github.com/users/EvgeniyBakunovich/received_events","type":"User","site_admin":false},"body":"## Фамилия Имя\r\nБакунович Евгений\r\n\r\n## Email\r\nbakunovichevgeniy@gmail.com\r\n\r\n## Номер домашнего задания\r\n1\r\n\r\n## Ссылка на видео с демо работы\r\nhttps://youtu.be/TRaric-QsbM\r\n\r\n## Комментарии\r\n\r\n","created_at":"2017-10-13T20:50:20Z","updated_at":"2017-10-13T20:50:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfe3daadda84bdb2ee975a8a4ec52560380b7fe9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587/commits","review_comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587/comments","review_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/587/comments","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/5e9901e8c487de6b89ad7a3de473932add3270e8","head":{"label":"EvgeniyBakunovich:homework-1","ref":"homework-1","sha":"5e9901e8c487de6b89ad7a3de473932add3270e8","user":{"login":"EvgeniyBakunovich","id":32778500,"avatar_url":"https://avatars3.githubusercontent.com/u/32778500?v=4","gravatar_id":"","url":"https://api.github.com/users/EvgeniyBakunovich","html_url":"https://github.com/EvgeniyBakunovich","followers_url":"https://api.github.com/users/EvgeniyBakunovich/followers","following_url":"https://api.github.com/users/EvgeniyBakunovich/following{/other_user}","gists_url":"https://api.github.com/users/EvgeniyBakunovich/gists{/gist_id}","starred_url":"https://api.github.com/users/EvgeniyBakunovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvgeniyBakunovich/subscriptions","organizations_url":"https://api.github.com/users/EvgeniyBakunovich/orgs","repos_url":"https://api.github.com/users/EvgeniyBakunovich/repos","events_url":"https://api.github.com/users/EvgeniyBakunovich/events{/privacy}","received_events_url":"https://api.github.com/users/EvgeniyBakunovich/received_events","type":"User","site_admin":false},"repo":{"id":106863874,"name":"bsuir-courses","full_name":"EvgeniyBakunovich/bsuir-courses","owner":{"login":"EvgeniyBakunovich","id":32778500,"avatar_url":"https://avatars3.githubusercontent.com/u/32778500?v=4","gravatar_id":"","url":"https://api.github.com/users/EvgeniyBakunovich","html_url":"https://github.com/EvgeniyBakunovich","followers_url":"https://api.github.com/users/EvgeniyBakunovich/followers","following_url":"https://api.github.com/users/EvgeniyBakunovich/following{/other_user}","gists_url":"https://api.github.com/users/EvgeniyBakunovich/gists{/gist_id}","starred_url":"https://api.github.com/users/EvgeniyBakunovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvgeniyBakunovich/subscriptions","organizations_url":"https://api.github.com/users/EvgeniyBakunovich/orgs","repos_url":"https://api.github.com/users/EvgeniyBakunovich/repos","events_url":"https://api.github.com/users/EvgeniyBakunovich/events{/privacy}","received_events_url":"https://api.github.com/users/EvgeniyBakunovich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EvgeniyBakunovich/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":true,"url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses","forks_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/forks","keys_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/events","assignees_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/merges","archive_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/releases{/id}","deployments_url":"https://api.github.com/repos/EvgeniyBakunovich/bsuir-courses/deployments","created_at":"2017-10-13T19:12:14Z","updated_at":"2017-10-13T19:12:17Z","pushed_at":"2017-10-13T20:22:31Z","git_url":"git://github.com/EvgeniyBakunovich/bsuir-courses.git","ssh_url":"git@github.com:EvgeniyBakunovich/bsuir-courses.git","clone_url":"https://github.com/EvgeniyBakunovich/bsuir-courses.git","svn_url":"https://github.com/EvgeniyBakunovich/bsuir-courses","homepage":null,"size":14433,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"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":"rubyroidlabs:master","ref":"master","sha":"4aee13f8b97435b8d3ca59d30aea93e3af4712b2","user":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars1.githubusercontent.com/u/5137565?v=4","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":14405320,"name":"bsuir-courses","full_name":"rubyroidlabs/bsuir-courses","owner":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars1.githubusercontent.com/u/5137565?v=4","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubyroidlabs/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":false,"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses","forks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/forks","keys_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/events","assignees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/merges","archive_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/releases{/id}","deployments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/deployments","created_at":"2013-11-14T19:55:12Z","updated_at":"2017-10-13T09:01:44Z","pushed_at":"2017-10-13T20:50:21Z","git_url":"git://github.com/rubyroidlabs/bsuir-courses.git","ssh_url":"git@github.com:rubyroidlabs/bsuir-courses.git","clone_url":"https://github.com/rubyroidlabs/bsuir-courses.git","svn_url":"https://github.com/rubyroidlabs/bsuir-courses","homepage":null,"size":14433,"stargazers_count":36,"watchers_count":36,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"open_issues_count":42,"forks":204,"open_issues":42,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/587"},"issue":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/587"},"comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/587/comments"},"review_comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587/comments"},"review_comment":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/587/commits"},"statuses":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/5e9901e8c487de6b89ad7a3de473932add3270e8"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}