{"action":"created","comment":{"url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/comments/42444072","id":42444072,"diff_hunk":"@@ -1,25 +1,41 @@\n class NoApplesError < StandardError; end\n \n-class AppleTree\n-  attr_#fill_in :height, :age, :apples, :alive\n+class Tree\n+  attr_reader :height, :age\n+  MAXIMUM_AGE = 100\n+  MAXIMUM_FRUIT_DIAMETER = 10\n \n   def initialize\n+    @height = 0.5\n+    @age = 0\n+    @apples = []\n   end\n \n   def age!\n+    @age += 1\n+    @height += 0.5 unless height >= 30\n+    add_apples\n   end\n \n   def add_apples\n+    if @age >= 3\n+      rand(@age / 2...@age).times do\n+        @apples.push(Apple.new('red', rand(MAXIMUM_FRUIT_DIAMETER)))\n+      end\n+    end\n   end\n \n   def any_apples?\n+    @apples.length > 0\n   end\n \n   def pick_an_apple!\n     raise NoApplesError, \"This tree has no apples\" unless self.any_apples?\n+    @apples.pop\n   end\n \n   def dead?\n+    @age >= MAXIMUM_AGE","path":"lib/tree.rb","position":40,"original_position":40,"commit_id":"2e3c1ec0a73a6e6319ea1da78c685a535ea3cf0b","original_commit_id":"2e3c1ec0a73a6e6319ea1da78c685a535ea3cf0b","user":{"login":"jaybobo","id":5685984,"avatar_url":"https://avatars.githubusercontent.com/u/5685984?v=3","gravatar_id":"","url":"https://api.github.com/users/jaybobo","html_url":"https://github.com/jaybobo","followers_url":"https://api.github.com/users/jaybobo/followers","following_url":"https://api.github.com/users/jaybobo/following{/other_user}","gists_url":"https://api.github.com/users/jaybobo/gists{/gist_id}","starred_url":"https://api.github.com/users/jaybobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaybobo/subscriptions","organizations_url":"https://api.github.com/users/jaybobo/orgs","repos_url":"https://api.github.com/users/jaybobo/repos","events_url":"https://api.github.com/users/jaybobo/events{/privacy}","received_events_url":"https://api.github.com/users/jaybobo/received_events","type":"User","site_admin":false},"body":"Its good practice to refer to the getter method in as many cases as possible. Imagine a scenario in which you have to make modifications to an instance variable before utilizing it in other methods. ","created_at":"2015-10-20T00:39:18Z","updated_at":"2015-10-20T00:39:18Z","html_url":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19#discussion_r42444072","pull_request_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/comments/42444072"},"html":{"href":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19#discussion_r42444072"},"pull_request":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19","id":48087929,"html_url":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19","diff_url":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19.diff","patch_url":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19.patch","issue_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/19","number":19,"state":"open","locked":false,"title":"Grow an apple tree","user":{"login":"nlegg","id":541654,"avatar_url":"https://avatars.githubusercontent.com/u/541654?v=3","gravatar_id":"","url":"https://api.github.com/users/nlegg","html_url":"https://github.com/nlegg","followers_url":"https://api.github.com/users/nlegg/followers","following_url":"https://api.github.com/users/nlegg/following{/other_user}","gists_url":"https://api.github.com/users/nlegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nlegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlegg/subscriptions","organizations_url":"https://api.github.com/users/nlegg/orgs","repos_url":"https://api.github.com/users/nlegg/repos","events_url":"https://api.github.com/users/nlegg/events{/privacy}","received_events_url":"https://api.github.com/users/nlegg/received_events","type":"User","site_admin":false},"body":"@jaybobo @mikegee ","created_at":"2015-10-19T15:37:03Z","updated_at":"2015-10-20T00:39:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18125aa5c54f46643ae57e04228675608101c215","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19/commits","review_comments_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19/comments","review_comment_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/19/comments","statuses_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/statuses/2e3c1ec0a73a6e6319ea1da78c685a535ea3cf0b","head":{"label":"nlegg:nlegg","ref":"nlegg","sha":"2e3c1ec0a73a6e6319ea1da78c685a535ea3cf0b","user":{"login":"nlegg","id":541654,"avatar_url":"https://avatars.githubusercontent.com/u/541654?v=3","gravatar_id":"","url":"https://api.github.com/users/nlegg","html_url":"https://github.com/nlegg","followers_url":"https://api.github.com/users/nlegg/followers","following_url":"https://api.github.com/users/nlegg/following{/other_user}","gists_url":"https://api.github.com/users/nlegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nlegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlegg/subscriptions","organizations_url":"https://api.github.com/users/nlegg/orgs","repos_url":"https://api.github.com/users/nlegg/repos","events_url":"https://api.github.com/users/nlegg/events{/privacy}","received_events_url":"https://api.github.com/users/nlegg/received_events","type":"User","site_admin":false},"repo":{"id":44539413,"name":"FixTheTreeTDD","full_name":"nlegg/FixTheTreeTDD","owner":{"login":"nlegg","id":541654,"avatar_url":"https://avatars.githubusercontent.com/u/541654?v=3","gravatar_id":"","url":"https://api.github.com/users/nlegg","html_url":"https://github.com/nlegg","followers_url":"https://api.github.com/users/nlegg/followers","following_url":"https://api.github.com/users/nlegg/following{/other_user}","gists_url":"https://api.github.com/users/nlegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nlegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlegg/subscriptions","organizations_url":"https://api.github.com/users/nlegg/orgs","repos_url":"https://api.github.com/users/nlegg/repos","events_url":"https://api.github.com/users/nlegg/events{/privacy}","received_events_url":"https://api.github.com/users/nlegg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nlegg/FixTheTreeTDD","description":"A TDD challenge exploring inheritance, OOP & reviewing broken code","fork":true,"url":"https://api.github.com/repos/nlegg/FixTheTreeTDD","forks_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/forks","keys_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/teams","hooks_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/hooks","issue_events_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/issues/events{/number}","events_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/events","assignees_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/assignees{/user}","branches_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/branches{/branch}","tags_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/tags","blobs_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/git/refs{/sha}","trees_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/statuses/{sha}","languages_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/languages","stargazers_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/stargazers","contributors_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/contributors","subscribers_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/subscribers","subscription_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/subscription","commits_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/commits{/sha}","git_commits_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/git/commits{/sha}","comments_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/comments{/number}","issue_comment_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/issues/comments{/number}","contents_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/contents/{+path}","compare_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/merges","archive_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/downloads","issues_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/issues{/number}","pulls_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/pulls{/number}","milestones_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/milestones{/number}","notifications_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/labels{/name}","releases_url":"https://api.github.com/repos/nlegg/FixTheTreeTDD/releases{/id}","created_at":"2015-10-19T14:11:10Z","updated_at":"2015-10-19T14:11:11Z","pushed_at":"2015-10-19T15:35:33Z","git_url":"git://github.com/nlegg/FixTheTreeTDD.git","ssh_url":"git@github.com:nlegg/FixTheTreeTDD.git","clone_url":"https://github.com/nlegg/FixTheTreeTDD.git","svn_url":"https://github.com/nlegg/FixTheTreeTDD","homepage":null,"size":100,"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":"paircolumbus:master","ref":"master","sha":"488e3ad16845efdd09211452681c79cf9e6ab193","user":{"login":"paircolumbus","id":8568348,"avatar_url":"https://avatars.githubusercontent.com/u/8568348?v=3","gravatar_id":"","url":"https://api.github.com/users/paircolumbus","html_url":"https://github.com/paircolumbus","followers_url":"https://api.github.com/users/paircolumbus/followers","following_url":"https://api.github.com/users/paircolumbus/following{/other_user}","gists_url":"https://api.github.com/users/paircolumbus/gists{/gist_id}","starred_url":"https://api.github.com/users/paircolumbus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paircolumbus/subscriptions","organizations_url":"https://api.github.com/users/paircolumbus/orgs","repos_url":"https://api.github.com/users/paircolumbus/repos","events_url":"https://api.github.com/users/paircolumbus/events{/privacy}","received_events_url":"https://api.github.com/users/paircolumbus/received_events","type":"Organization","site_admin":false},"repo":{"id":25720009,"name":"FixTheTreeTDD","full_name":"paircolumbus/FixTheTreeTDD","owner":{"login":"paircolumbus","id":8568348,"avatar_url":"https://avatars.githubusercontent.com/u/8568348?v=3","gravatar_id":"","url":"https://api.github.com/users/paircolumbus","html_url":"https://github.com/paircolumbus","followers_url":"https://api.github.com/users/paircolumbus/followers","following_url":"https://api.github.com/users/paircolumbus/following{/other_user}","gists_url":"https://api.github.com/users/paircolumbus/gists{/gist_id}","starred_url":"https://api.github.com/users/paircolumbus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paircolumbus/subscriptions","organizations_url":"https://api.github.com/users/paircolumbus/orgs","repos_url":"https://api.github.com/users/paircolumbus/repos","events_url":"https://api.github.com/users/paircolumbus/events{/privacy}","received_events_url":"https://api.github.com/users/paircolumbus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paircolumbus/FixTheTreeTDD","description":"A TDD challenge exploring inheritance, OOP & reviewing broken code","fork":false,"url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD","forks_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/forks","keys_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/teams","hooks_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/hooks","issue_events_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/events{/number}","events_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/events","assignees_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/assignees{/user}","branches_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/branches{/branch}","tags_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/tags","blobs_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/git/refs{/sha}","trees_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/statuses/{sha}","languages_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/languages","stargazers_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/stargazers","contributors_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/contributors","subscribers_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/subscribers","subscription_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/subscription","commits_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/commits{/sha}","git_commits_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/git/commits{/sha}","comments_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/comments{/number}","issue_comment_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/comments{/number}","contents_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/contents/{+path}","compare_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/merges","archive_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/downloads","issues_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues{/number}","pulls_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls{/number}","milestones_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/milestones{/number}","notifications_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/labels{/name}","releases_url":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/releases{/id}","created_at":"2014-10-25T04:32:40Z","updated_at":"2015-01-02T17:45:00Z","pushed_at":"2015-10-19T15:37:03Z","git_url":"git://github.com/paircolumbus/FixTheTreeTDD.git","ssh_url":"git@github.com:paircolumbus/FixTheTreeTDD.git","clone_url":"https://github.com/paircolumbus/FixTheTreeTDD.git","svn_url":"https://github.com/paircolumbus/FixTheTreeTDD","homepage":null,"size":371,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":17,"forks":14,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19"},"html":{"href":"https://github.com/paircolumbus/FixTheTreeTDD/pull/19"},"issue":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/19"},"comments":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/paircolumbus/FixTheTreeTDD/statuses/2e3c1ec0a73a6e6319ea1da78c685a535ea3cf0b"}}}}