From ec601c168aa50368822411d7487e81027388db53 Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Fri, 30 Oct 2015 10:17:15 -0400 Subject: [PATCH] Adds combined comparison operator to Ruby --- ruby.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..6114c14e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -77,6 +77,11 @@ false.class #=> FalseClass 2 <= 2 #=> true 2 >= 2 #=> true +# Combined comparison operator +1 <=> 10 #=> -1 +10 <=> 1 #=> 1 +1 <=> 1 #=> 0 + # Logical operators true && false #=> false true || false #=> true