summaryrefslogtreecommitdiffhomepage
path: root/ruby.html.markdown
diff options
context:
space:
mode:
authorJake Faris <jake.faris@alphasights.com>2015-10-30 10:17:15 -0400
committerJake Faris <jake.faris@alphasights.com>2015-10-30 10:17:15 -0400
commitec601c168aa50368822411d7487e81027388db53 (patch)
treeb59dade295c733020307e7c1ebdcd7fb75e702b8 /ruby.html.markdown
parentf0a4c88acfac9514aca6dd33e2d3f8c4d5e815dc (diff)
Adds combined comparison operator to Ruby
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r--ruby.html.markdown5
1 files changed, 5 insertions, 0 deletions
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