summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-04 11:44:13 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-04 11:44:13 +0000
commit6928faa6ab7825d32a46c7c3ca48d438df50635c (patch)
tree806ad7a888d03527ae1fa8bd8830dfe9aae7e4c4 /struct.c
parent83e459b2f3afc48ff4b6c61b713e2854ccd30a13 (diff)
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
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index 30dfbf21e6..ece7ebc8a1 100644
--- a/struct.c
+++ b/struct.c
@@ -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