The equal operator "=" is used in Ruby as an assignment operator. This holds true for both variables and objects, because in Ruby, strings, floats, and integers are all objects, and you're always assigning objects.
Assignment operations can be divided into two categories: The value of the second operand is saved in the object defined by the first operand in a simple assignment. Before storing the result, a compound assignment performs an arithmetic, shift, or bitwise operation.
Share a personalized message with your friends.