We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bc83b1a + 5b0e3ff commit 19b5e02Copy full SHA for 19b5e02
README.adoc
@@ -1463,6 +1463,23 @@ pets = %w(cat dog)
1463
pets.include? 'cat'
1464
----
1465
1466
+=== `exclude?` [[exclude]]
1467
+
1468
+Prefer Active Support's `exclude?` over Ruby's negated `include?`.
1469
1470
+[source,ruby]
1471
+----
1472
+# bad
1473
+!array.include?(2)
1474
+!hash.include?(:key)
1475
+!string.include?('substring')
1476
1477
+# good
1478
+array.exclude?(2)
1479
+hash.exclude?(:key)
1480
+string.exclude?('substring')
1481
1482
1483
== Time
1484
1485
=== Time Zone Config [[tz-config]]
0 commit comments