1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-30 01:50:25 +02:00

Merge pull request #987 from geoffliu/master

[Ruby/en] Add logical operators to Ruby tutorial
This commit is contained in:
Levi Bostian
2015-03-04 23:39:55 -06:00

View File

@@ -60,8 +60,6 @@ false.class #=> FalseClass
# Inequality
1 != 1 #=> false
2 != 1 #=> true
!true #=> false
!false #=> true
# apart from false itself, nil is the only other 'falsey' value
@@ -75,6 +73,17 @@ false.class #=> FalseClass
2 <= 2 #=> true
2 >= 2 #=> true
# Logical operators
true && false #=> false
true || false #=> true
!true #=> false
# Alternate spellings of logical operators
true and false #=> false
true or false #=> true
not true #=> false
# Strings are objects
'I am a string'.class #=> String