diff options
| author | Koichi ITO <koic.ito@gmail.com> | 2025-12-21 04:47:55 +0900 |
|---|---|---|
| committer | Satoshi Tagomori <tagomoris@gmail.com> | 2026-01-04 12:53:42 +0900 |
| commit | ca0fece56a3ddfa6b9ec9cf1652e414929040614 (patch) | |
| tree | 0c0a22d478c54f92b7f025edd1423a8fb4e95d03 /test | |
| parent | d8d41d7441aabae5e5948f89cd759bbdc3bf5532 (diff) | |
[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?`.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
