[ENGLISH VERSION] Classes 101: Methods

Hey, how are you? Like said on the first post of this serie, today we are going to know how we add new methods to our class, and so much more. Inside the method initialize we can have anything and today we are going to use it to "initialize" our variables. We use the @ … Continue lendo [ENGLISH VERSION] Classes 101: Methods



Hey, how are you!?! Well, today I bring the way how Ruby treats it's switch case. Let's go! The easy way is: The case must end with an end, showing that the condition is done and each case is tested with a when statement. THEN Now the variations. The first one is with the then … Continue lendo [ENGLISH VERSION] Ruby Case

[ENGLISH VERSION] Practical Guide: Spaceship Operator (<=>)

Hey, how are you?! Represented by <=>, the remarkeble Spaceship Operator works the same way, that his endings: like a comparison opertor, three-way comparison, being a key element in sorting methods. The little spaceship (got it?) counts with three types of comparision, always done from left to right, and can return three values as well: … Continue lendo [ENGLISH VERSION] Practical Guide: Spaceship Operator (<=>)