{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments/35780640","id":35780640,"diff_hunk":"@@ -1,2 +1,55 @@\n+require_relative 'plane'\n+# As a pilot\n+# So that I can arrive at my specified destination\n+# I would like to land my plane at the appropriate airport\n+\n+# As a pilot\n+# So that I can set off for my specified destination\n+# I would like to be able to take off from the appropriate airport\n+\n+# As an air traffic controller\n+# So that I can avoid collisions\n+# I want to be able to prevent airplanes landing when the airport if full\n+\n+# As an air traffic controller\n+# So that I can avoid accidents\n+# I want to be able to prevent airplanes landing or taking off when the weather is stormy\n+\n class Airport\n+  D_CAPACITY = 50\n+\n+  attr_accessor :planes\n+  attr_accessor :capacity\n+  attr_accessor :weather\n+\n+  def initialize(capacity = D_CAPACITY, weather = 'sunny')\n+    @capacity = capacity\n+    @planes = []\n+    @weather = weather\n+  end\n+\n+  def take_off\n+    fail 'Weather is bad for take off' if weather == 'stormy'\n+    planes.last.off\n+    @planes.pop\n+  end\n+\n+  def landing(plane)\n+    fail 'Weather is bad for landing' if weather == 'stormy'\n+    fail 'Airport full' if full?\n+    plane.land\n+    @planes << plane\n+  end\n+\n+  def empty?\n+    @planes.empty?\n+  end\n+\n+  def full?\n+    @planes.count >= capacity\n+  end\n+\n+  def change_weather(num = rand(100))\n+    num <= 30 ? @weather = 'stormy' : @weather = 'sunny'\n+  end\n end","path":"lib/airport.rb","position":55,"original_position":55,"commit_id":"5a976a8ac1cc5d5d51d2a1cf8b7ad6bc5af3045d","original_commit_id":"5a976a8ac1cc5d5d51d2a1cf8b7ad6bc5af3045d","user":{"login":"danldb","id":6850045,"avatar_url":"https://avatars.githubusercontent.com/u/6850045?v=3","gravatar_id":"","url":"https://api.github.com/users/danldb","html_url":"https://github.com/danldb","followers_url":"https://api.github.com/users/danldb/followers","following_url":"https://api.github.com/users/danldb/following{/other_user}","gists_url":"https://api.github.com/users/danldb/gists{/gist_id}","starred_url":"https://api.github.com/users/danldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danldb/subscriptions","organizations_url":"https://api.github.com/users/danldb/orgs","repos_url":"https://api.github.com/users/danldb/repos","events_url":"https://api.github.com/users/danldb/events{/privacy}","received_events_url":"https://api.github.com/users/danldb/received_events","type":"User","site_admin":false},"body":"Extract this into a module or class and inject it.","created_at":"2015-07-29T16:33:27Z","updated_at":"2015-07-29T16:33:27Z","html_url":"https://github.com/makersacademy/airport_challenge/pull/107#discussion_r35780640","pull_request_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments/35780640"},"html":{"href":"https://github.com/makersacademy/airport_challenge/pull/107#discussion_r35780640"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107","id":40855369,"html_url":"https://github.com/makersacademy/airport_challenge/pull/107","diff_url":"https://github.com/makersacademy/airport_challenge/pull/107.diff","patch_url":"https://github.com/makersacademy/airport_challenge/pull/107.patch","issue_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/107","number":107,"state":"open","locked":false,"title":"work so far","user":{"login":"Aftermaths","id":12613780,"avatar_url":"https://avatars.githubusercontent.com/u/12613780?v=3","gravatar_id":"","url":"https://api.github.com/users/Aftermaths","html_url":"https://github.com/Aftermaths","followers_url":"https://api.github.com/users/Aftermaths/followers","following_url":"https://api.github.com/users/Aftermaths/following{/other_user}","gists_url":"https://api.github.com/users/Aftermaths/gists{/gist_id}","starred_url":"https://api.github.com/users/Aftermaths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aftermaths/subscriptions","organizations_url":"https://api.github.com/users/Aftermaths/orgs","repos_url":"https://api.github.com/users/Aftermaths/repos","events_url":"https://api.github.com/users/Aftermaths/events{/privacy}","received_events_url":"https://api.github.com/users/Aftermaths/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-26T16:05:56Z","updated_at":"2015-07-29T16:33:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5913c6b33f41d820ab16bac65abb1fb4b2e4105","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107/commits","review_comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107/comments","review_comment_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/107/comments","statuses_url":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/5a976a8ac1cc5d5d51d2a1cf8b7ad6bc5af3045d","head":{"label":"Aftermaths:master","ref":"master","sha":"5a976a8ac1cc5d5d51d2a1cf8b7ad6bc5af3045d","user":{"login":"Aftermaths","id":12613780,"avatar_url":"https://avatars.githubusercontent.com/u/12613780?v=3","gravatar_id":"","url":"https://api.github.com/users/Aftermaths","html_url":"https://github.com/Aftermaths","followers_url":"https://api.github.com/users/Aftermaths/followers","following_url":"https://api.github.com/users/Aftermaths/following{/other_user}","gists_url":"https://api.github.com/users/Aftermaths/gists{/gist_id}","starred_url":"https://api.github.com/users/Aftermaths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aftermaths/subscriptions","organizations_url":"https://api.github.com/users/Aftermaths/orgs","repos_url":"https://api.github.com/users/Aftermaths/repos","events_url":"https://api.github.com/users/Aftermaths/events{/privacy}","received_events_url":"https://api.github.com/users/Aftermaths/received_events","type":"User","site_admin":false},"repo":{"id":39646394,"name":"airport_challenge","full_name":"Aftermaths/airport_challenge","owner":{"login":"Aftermaths","id":12613780,"avatar_url":"https://avatars.githubusercontent.com/u/12613780?v=3","gravatar_id":"","url":"https://api.github.com/users/Aftermaths","html_url":"https://github.com/Aftermaths","followers_url":"https://api.github.com/users/Aftermaths/followers","following_url":"https://api.github.com/users/Aftermaths/following{/other_user}","gists_url":"https://api.github.com/users/Aftermaths/gists{/gist_id}","starred_url":"https://api.github.com/users/Aftermaths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aftermaths/subscriptions","organizations_url":"https://api.github.com/users/Aftermaths/orgs","repos_url":"https://api.github.com/users/Aftermaths/repos","events_url":"https://api.github.com/users/Aftermaths/events{/privacy}","received_events_url":"https://api.github.com/users/Aftermaths/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aftermaths/airport_challenge","description":"Fly!","fork":true,"url":"https://api.github.com/repos/Aftermaths/airport_challenge","forks_url":"https://api.github.com/repos/Aftermaths/airport_challenge/forks","keys_url":"https://api.github.com/repos/Aftermaths/airport_challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aftermaths/airport_challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aftermaths/airport_challenge/teams","hooks_url":"https://api.github.com/repos/Aftermaths/airport_challenge/hooks","issue_events_url":"https://api.github.com/repos/Aftermaths/airport_challenge/issues/events{/number}","events_url":"https://api.github.com/repos/Aftermaths/airport_challenge/events","assignees_url":"https://api.github.com/repos/Aftermaths/airport_challenge/assignees{/user}","branches_url":"https://api.github.com/repos/Aftermaths/airport_challenge/branches{/branch}","tags_url":"https://api.github.com/repos/Aftermaths/airport_challenge/tags","blobs_url":"https://api.github.com/repos/Aftermaths/airport_challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aftermaths/airport_challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aftermaths/airport_challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aftermaths/airport_challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aftermaths/airport_challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/Aftermaths/airport_challenge/languages","stargazers_url":"https://api.github.com/repos/Aftermaths/airport_challenge/stargazers","contributors_url":"https://api.github.com/repos/Aftermaths/airport_challenge/contributors","subscribers_url":"https://api.github.com/repos/Aftermaths/airport_challenge/subscribers","subscription_url":"https://api.github.com/repos/Aftermaths/airport_challenge/subscription","commits_url":"https://api.github.com/repos/Aftermaths/airport_challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aftermaths/airport_challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aftermaths/airport_challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aftermaths/airport_challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aftermaths/airport_challenge/contents/{+path}","compare_url":"https://api.github.com/repos/Aftermaths/airport_challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aftermaths/airport_challenge/merges","archive_url":"https://api.github.com/repos/Aftermaths/airport_challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aftermaths/airport_challenge/downloads","issues_url":"https://api.github.com/repos/Aftermaths/airport_challenge/issues{/number}","pulls_url":"https://api.github.com/repos/Aftermaths/airport_challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/Aftermaths/airport_challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/Aftermaths/airport_challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aftermaths/airport_challenge/labels{/name}","releases_url":"https://api.github.com/repos/Aftermaths/airport_challenge/releases{/id}","created_at":"2015-07-24T17:01:31Z","updated_at":"2015-07-24T17:01:39Z","pushed_at":"2015-07-26T16:05:01Z","git_url":"git://github.com/Aftermaths/airport_challenge.git","ssh_url":"git@github.com:Aftermaths/airport_challenge.git","clone_url":"https://github.com/Aftermaths/airport_challenge.git","svn_url":"https://github.com/Aftermaths/airport_challenge","homepage":"","size":113,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"makersacademy:master","ref":"master","sha":"bc7464938497f58404dc4037ecc5806d399ad517","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":27074983,"name":"airport_challenge","full_name":"makersacademy/airport_challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/airport_challenge","description":"Fly!","fork":false,"url":"https://api.github.com/repos/makersacademy/airport_challenge","forks_url":"https://api.github.com/repos/makersacademy/airport_challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/airport_challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/airport_challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/airport_challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/airport_challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/airport_challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/airport_challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/airport_challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/airport_challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/airport_challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/airport_challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/airport_challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/airport_challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/airport_challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/airport_challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/airport_challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/airport_challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/airport_challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/airport_challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/airport_challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/airport_challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/airport_challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/airport_challenge/releases{/id}","created_at":"2014-11-24T12:30:39Z","updated_at":"2015-06-13T06:36:50Z","pushed_at":"2015-07-28T19:42:30Z","git_url":"git://github.com/makersacademy/airport_challenge.git","ssh_url":"git@github.com:makersacademy/airport_challenge.git","clone_url":"https://github.com/makersacademy/airport_challenge.git","svn_url":"https://github.com/makersacademy/airport_challenge","homepage":"","size":3789,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":19,"forks":112,"open_issues":19,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107"},"html":{"href":"https://github.com/makersacademy/airport_challenge/pull/107"},"issue":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/issues/107"},"comments":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/5a976a8ac1cc5d5d51d2a1cf8b7ad6bc5af3045d"}}}}