Commit ca0fece
[DOC] Tweak an example in language/box.md
Although the example code comments indicate that it returns `false`,
a non-matching result for `=~` is actually `nil`.
```ruby
Foo.foo.blank? #=> false
"foo".blank? #=> false
```
https://github.com/ruby/ruby/blob/v4.0.0-preview3/doc/language/box.md?plain=1#L115-L122
This PR replaces `=~` with `match?` so that it returns the expected `false`.
Since this makes the result a boolean, it also aligns with the expected behavior of
a predicate method name like `blank?`.1 parent d8d41d7 commit ca0fece
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
0 commit comments