1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

struct.c: [DOC] add docs for Struct#filter

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2018-11-04 11:44:13 +00:00
parent 83e459b2f3
commit 6928faa6ab

View file

@ -1100,6 +1100,8 @@ rb_struct_values_at(int argc, VALUE *argv, VALUE s)
* call-seq:
* struct.select {|obj| block } -> array
* struct.select -> enumerator
* struct.filter {|obj| block } -> array
* struct.filter -> enumerator
*
* Yields each member value from the struct to the block and returns an Array
* containing the member values from the +struct+ for which the given block
@ -1108,6 +1110,8 @@ rb_struct_values_at(int argc, VALUE *argv, VALUE s)
* Lots = Struct.new(:a, :b, :c, :d, :e, :f)
* l = Lots.new(11, 22, 33, 44, 55, 66)
* l.select {|v| v.even? } #=> [22, 44, 66]
*
* Struct#filter is an alias for Struct#select.
*/
static VALUE