Skip to content

Commit 4f440e7

Browse files
Mikey Goughmikeygough
authored andcommitted
Disable rubocop for empty case statement in documentation example
1 parent f54140e commit 4f440e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

static_docs/case.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Ruby also allows `case` statements without an explicit argument, which acts like
8484

8585
```ruby
8686
# Case statement without an argument
87+
# rubocop:disable Style/EmptyCaseCondition
8788
case
8889
when Time.now.saturday?
8990
puts "It's Saturday!"
@@ -92,6 +93,7 @@ when Time.now.sunday?
9293
else
9394
puts "It's a weekday"
9495
end
96+
# rubocop:enable Style/EmptyCaseCondition
9597
```
9698

9799
The case statement is particularly useful when you have multiple conditions to check against a single value, or when you want to use pattern matching to destructure complex data structures.

0 commit comments

Comments
 (0)