mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[DOC] Add multiline condition code example that was already possible
To avoid the misconception that previously conditional code had to be written on a single line.
This commit is contained in:
parent
cfb324e9d1
commit
87e78e6f8a
Notes:
git
2025-12-22 05:51:34 +00:00
11
NEWS.md
11
NEWS.md
@ -12,7 +12,7 @@ Note that each entry is kept to a minimum, see links for details.
|
||||
|
||||
* Logical binary operators (`||`, `&&`, `and` and `or`) at the
|
||||
beginning of a line continue the previous line, like fluent dot.
|
||||
The following two code examples are equal:
|
||||
The following code examples are equal:
|
||||
|
||||
```ruby
|
||||
if condition1
|
||||
@ -21,12 +21,21 @@ Note that each entry is kept to a minimum, see links for details.
|
||||
end
|
||||
```
|
||||
|
||||
Previously:
|
||||
|
||||
```ruby
|
||||
if condition1 && condition2
|
||||
...
|
||||
end
|
||||
```
|
||||
|
||||
```ruby
|
||||
if condition1 &&
|
||||
condition2
|
||||
...
|
||||
end
|
||||
```
|
||||
|
||||
[[Feature #20925]]
|
||||
|
||||
## Core classes updates
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user