Right Angle Bracket
The >
(right angle bracket) symbol is used (by itself) in Ruby for a greater than comparison of two objects.
Not quite what you're looking for? The >
symbol shows up as part of other Ruby operators and syntax like hash rockets ({"a" => "b"}
), the Shift Operator (>>
), the Spaceship operator (<=>
), the Lambda Proc Literal (-> { ... }
), and rescue assignment (rescue Ex => e
).
Greater Than Comparison
We can compare any two objects of the same type as long as they are Comparable
↗.
> 10 > 9
=> true
> 9 > 10
=> false
> 'xyz' > 'abc'
=> true
> 'A' > 'z'
=> false
> 'a' > 'Z'
=> true
Numeric types, strings, dates, and times are all common examples of elements that get compared this way.