class Airport
attr_reader :plane
CAPACITY = 20
def initialize
@plane = []
@capacity = CAPACITY
end
#can land a plane
def land(plane)
fail 'plane is full' if @plane.count >= @capacity
@plane << plane
end
def take_off
fail 'weather is stormy' if @weather
@plane
end
def weather
@weather = weather
end
end
class Weather
def stormy?
[true, false].sample
end
end
I am new to Ruby. I am a little confused in how to use the method of the Weather class in my Airport class.
I want the take_off method in my Airport class to fail when the weather is reported to be stormy. I am unsure where to begin in understanding object interactions. Any help would be greatly appreciated, thank you