1. = (equal to) and! = (Not equal)
Returns true and flase if the values of the two objects are equal.
A = 1; B = 1.0; A = B # True
2. eql?
Returns true and flase if the values and types of the two objects are equal.
A = 1; B = 1.0; A. eql? (B) # flase (A is an integer and B is a floating point)
3. Equal?
Returns true and flase if two objects have the same address in the memory.
A = 1.0; B = 1.0; A. Equal? (B) # flase
A = 1.0; B = A; A. Equal? (B) # True
4. <=>
Compare the sizes of two objects. If the values are greater than, equal to, or less than, 1, 0,-1 are returned.
"AAB" <=> "ACB" #-1 (the ASCII code of the second A is less than C)
[5] <=> [4, 9] #1 (first element 5> 4)
5. =
Returns true and flase if the object on the right is within the left range.
Puts (0 .. 9) === 3.14 # True
Puts ('A' .. 'F') = 'C' # True
6. = ~ (Matching)
Used to compare whether a regular expression is met. The return mode is the position matched in the string. Otherwise, Nil is returned.
7 .!~ (Mismatch)
Returns true, flase