Ruby operators

From wikinotes

normal operators

and
or
1 == 1
1 != 0
1 <= 2
2 >= 1
'foo' =~ 'foobar'  # 'foobar' contains 'foo'
a ||= b            # `a || a = b`   (if a is not defined, a = b)

ruby specific operators

obj_1 eql? obj_2    # if type/value match
obj_1 equal? obj_2  # if objects refer to same instance
(1..5) === 3        # If a described a set, would b be a member of that set

unary operators

!!function()      # !! converts result to a boolean
*['a', 'b', 'c']  # splat operator converts list to a set of args

ternary operator

val = val_if_true ? condition : val_if_false
var += 1
var -= 1