[前][次][番号順一覧][スレッド一覧]

ruby-changes:53316

From: stomar <ko1@a...>
Date: Sun, 4 Nov 2018 20:50:39 +0900 (JST)
Subject: [ruby-changes:53316] stomar:r65531 (trunk): struct.c: [DOC] add docs for Struct#filter

stomar	2018-11-04 20:44:13 +0900 (Sun, 04 Nov 2018)

  New Revision: 65531

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65531

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

  Modified files:
    trunk/struct.c
Index: struct.c
===================================================================
--- struct.c	(revision 65530)
+++ struct.c	(revision 65531)
@@ -1100,6 +1100,8 @@ rb_struct_values_at(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/struct.c#L1100
  *  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 *arg https://github.com/ruby/ruby/blob/trunk/struct.c#L1110
  *     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]