mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add a comment about Integer#downto Enumerator
This commit is contained in:
parent
01db456196
commit
907146973a
Notes:
git
2024-11-13 20:27:43 +00:00
1 changed files with 2 additions and 0 deletions
|
@ -329,6 +329,8 @@ class Integer
|
|||
def downto(to) # :nodoc:
|
||||
Primitive.attr! :inline_block, :c_trace
|
||||
|
||||
# When no block is given, return an Enumerator that enumerates from `self` to `to`.
|
||||
# Not using `block_defined?` and `to_enum` to keep them unaffected by redefinitions.
|
||||
unless defined?(yield)
|
||||
return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 1, &to, int_downto_size)'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue