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.
1 parent 85a902d commit 5b0e3ffCopy full SHA for 5b0e3ff
README.adoc
@@ -1431,6 +1431,23 @@ pets = %w(cat dog)
1431
pets.include? 'cat'
1432
----
1433
1434
+=== `exclude?` [[exclude]]
1435
+
1436
+Prefer Active Support's `exclude?` over Ruby's negated `include?`.
1437
1438
+[source,ruby]
1439
+----
1440
+# bad
1441
+!array.include?(2)
1442
+!hash.include?(:key)
1443
+!string.include?('substring')
1444
1445
+# good
1446
+array.exclude?(2)
1447
+hash.exclude?(:key)
1448
+string.exclude?('substring')
1449
1450
1451
== Time
1452
1453
=== Time Zone Config [[tz-config]]
0 commit comments