Working with an amusement park, you've been handed a specification to design a system to administer attendance and rides. You've been tasked with modeling the Attendee (person visiting the park).
Implement the Attendee#initialize method of the Attendee class, it should take a height (in centimeters) and store it as an instance variable
Attendee.new(106)
# => #<Attendee:0x000055c33e6c7e18 @height=106>Implement the Attendee#height getter of the Attendee class, it should return the instances height
Attendee.new(106).height
# => 106Not all attendees have bought a ride pass, but we need to know if they have a pass or not. Implement the Attendee#pass_id getter for the Attendee class, it should return the instance's pass_id or nil if the Attendee doesn't have one.
Attendee.new(106).pass_id
# => nilImplement Attendee#issue_pass! to mutate the state of the instance, and set the pass id instance variable to the argument. It should return the pass id.
attendee = Attendee.new(106)
attendee.issue_pass!(42)
attendee.pass_id
# => 42Some guests break the rules with unsafe behavior, so the park wants to be able to revoke passes. Implement Attendee#revoke_pass! to mutate the state of the instance, and set the pass id to nil
attendee = Attendee.new(106)
attendee.issue_pass!(42)
attendee.revoke_pass!
attendee.pass_id
# => nilWorking with an amusement park, you've been handed a specification to design a system to administer attendance and rides. You've been tasked with modeling the Attendee (person visiting the park).
Implement the Attendee#initialize method of the Attendee class, it should take a height (in centimeters) and store it as an instance variable
Attendee.new(106)
# => #<Attendee:0x000055c33e6c7e18 @height=106>Implement the Attendee#height getter of the Attendee class, it should return the instances height
Attendee.new(106).height
# => 106Not all attendees have bought a ride pass, but we need to know if they have a pass or not. Implement the Attendee#pass_id getter for the Attendee class, it should return the instance's pass_id or nil if the Attendee doesn't have one.
Attendee.new(106).pass_id
# => nilImplement Attendee#issue_pass! to mutate the state of the instance, and set the pass id instance variable to the argument. It should return the pass id.
attendee = Attendee.new(106)
attendee.issue_pass!(42)
attendee.pass_id
# => 42Some guests break the rules with unsafe behavior, so the park wants to be able to revoke passes. Implement Attendee#revoke_pass! to mutate the state of the instance, and set the pass id to nil
attendee = Attendee.new(106)
attendee.issue_pass!(42)
attendee.revoke_pass!
attendee.pass_id
# => nil