Amusement Park Improvements
Solution
class Attendee
def initialize(height)
@height = height
end
def issue_pass!(pass_id)
@pass_id = pass_id if pass_id.is_a?(Integer)
end
def revoke_pass!
@pass_id = nil
end
def has_pass?
@pass_id || false
end
def fits_ride?(ride_minimum_height)
@height >= ride_minimum_height
end
def allowed_to_ride?(ride_minimum_height)
has_pass? && fits_ride?(ride_minimum_height)
end
end