dimanche 17 juillet 2016

How to check ruby attributes with an if statement?

i started learning Ruby but i got also an intermediate C# background. Yesterday i was trying to build a console elevator simulator in OOP.

I declared three attributes, currentFloor, minFloor and maxFloor with attr_accessor and symbols.

Now i got a question, in currentFloor reader method how can i check if the value is greater than maxFloor or lower than minFloor?

Aucun commentaire:

Enregistrer un commentaire