5件ヒット
[1-5件を表示]
(0.089秒)
別のキーワード
検索結果
先頭5件
-
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (739.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (739.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# enum _ for(method = :each , *args) -> Enumerator (439.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) -> Enumerator (439.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# tap {|x| . . . } -> self (43.0) -
self を引数としてブロックを評価し、self を返します。
...目的です。
//emlist[][ruby]{
(1..10) .tap {|x| puts "original: #{x}" }
.to_a .tap {|x| puts "array: #{x}" }
.select {|x| x.even? } .tap {|x| puts "evens: #{x}" }
.map {|x| x*x } .tap {|x| puts "squares: #{x}" }
//}
@see Object#yield_self...