airport challenge - #2516
Conversation
| require_relative 'plane' | ||
|
|
||
| class Airport | ||
| DEFAULT_CAPACITY = 3 |
There was a problem hiding this comment.
Good use of a constant variable - omits the risk of using magic numbers
|
|
||
| def initialize(capacity = DEFAULT_CAPACITY) | ||
| @planes_at_airport = [] | ||
| @capacity = capacity |
There was a problem hiding this comment.
@capacity = capacity can be changed to @capacity
| @capacity = capacity | ||
| end | ||
|
|
||
| def land(_plane) |
There was a problem hiding this comment.
_plane argument is not used within method, potentially can be omitted with caution, (I think).
| end | ||
|
|
||
| def storm? | ||
| rand(10) >= 8 |
There was a problem hiding this comment.
Good way to make weather sunny most of the time
| DEFAULT_CAPACITY = 3 | ||
|
|
||
| # makes capacity variable | ||
| attr_accessor :capacity |
There was a problem hiding this comment.
attr_accessor can be changed to attr_reader
AKCDNG
left a comment
There was a problem hiding this comment.
As an overview, the code is really neat. Everything is described well & a lot of the code made sense to me as to what it did. There are some comments that can be omitted but we spoke about that in person. There are some areas where there are opportunities to refactor your code which I've pointed out in the comments. Overall the code made a lot of sense for me to read.
Laura Voss
Please write your full name here to make it easier to find your pull request.
User stories
Please list which user stories you've implemented (delete the ones that don't apply).
README checklist
Does your README contains instructions for
Here is a pill that can help you write a great README!