mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
documentation from Thomas Leitner <t_leitner AT gmx.at> in [ruby-core:41616]. [Bug #5752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
046517c061
commit
58b5838d4e
3 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Dec 15 10:44:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
|
||||
documentation from Thomas Leitner <t_leitner AT gmx.at> in
|
||||
[ruby-core:41616]. [Bug #5752]
|
||||
|
||||
Wed Dec 14 15:28:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* transcode.c (str_encode): about the extension of :fallback
|
||||
|
|
4
array.c
4
array.c
|
@ -2606,6 +2606,8 @@ ary_reject_bang(VALUE ary)
|
|||
* Equivalent to <code>Array#delete_if</code>, deleting elements from
|
||||
* +self+ for which the block evaluates to true, but returns
|
||||
* <code>nil</code> if no changes were made.
|
||||
* The array is changed instantly every time the block is called and
|
||||
* not after the iteration is over.
|
||||
* See also <code>Enumerable#reject</code> and <code>Array#delete_if</code>.
|
||||
*
|
||||
* If no block is given, an enumerator is returned instead.
|
||||
|
@ -2650,6 +2652,8 @@ rb_ary_reject(VALUE ary)
|
|||
*
|
||||
* Deletes every element of +self+ for which <i>block</i> evaluates
|
||||
* to true.
|
||||
* The array is changed instantly every time the block is called and
|
||||
* not after the iteration is over.
|
||||
* See also <code>Array#reject!</code>
|
||||
*
|
||||
* If no block is given, an enumerator is returned instead.
|
||||
|
|
|
@ -610,7 +610,7 @@ class TestArray < Test::Unit::TestCase
|
|||
|
||||
bug2545 = '[ruby-core:27366]'
|
||||
a = @cls[ 5, 6, 7, 8, 9, 10 ]
|
||||
assert_equal(9, a.delete_if {|i| break i if i > 8; i < 7})
|
||||
assert_equal(9, a.delete_if {|i| break i if i > 8; assert_equal(a[0], i) || true if i < 7})
|
||||
assert_equal(@cls[7, 8, 9, 10], a, bug2545)
|
||||
end
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ class TestArray < Test::Unit::TestCase
|
|||
|
||||
bug2545 = '[ruby-core:27366]'
|
||||
a = @cls[ 5, 6, 7, 8, 9, 10 ]
|
||||
assert_equal(9, a.reject! {|i| break i if i > 8; i < 7})
|
||||
assert_equal(9, a.reject! {|i| break i if i > 8; assert_equal(a[0], i) || true if i < 7})
|
||||
assert_equal(@cls[7, 8, 9, 10], a, bug2545)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue