зеркало из https://github.com/github/ruby.git
Add Range#% to call-seq [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f251ce9f48
Коммит
41aa841a52
4
range.c
4
range.c
|
@ -350,10 +350,14 @@ range_step_size(VALUE range, VALUE args, VALUE eobj)
|
|||
}
|
||||
|
||||
/*
|
||||
* Document-method: Range#step
|
||||
* Document-method: Range#%
|
||||
* call-seq:
|
||||
* rng.step(n=1) {| obj | block } -> rng
|
||||
* rng.step(n=1) -> an_enumerator
|
||||
* rng.step(n=1) -> an_arithmetic_sequence
|
||||
* rng % n -> an_enumerator
|
||||
* rng % n -> an_arithmetic_sequence
|
||||
*
|
||||
* Iterates over the range, passing each <code>n</code>th element to the block.
|
||||
* If begin and end are numeric, +n+ is added for each iteration.
|
||||
|
|
Загрузка…
Ссылка в новой задаче