60件ヒット
[1-60件を表示]
(0.075秒)
検索結果
先頭5件
-
Object
# enum _ for(method = :each , *args) -> Enumerator (38.0) -
Enumerator.new(self, method, *args) を返します。
...# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (38.0) -
Enumerator.new(self, method, *args) を返します。
...# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)... -
Object
# to _ enum(method = :each , *args) -> Enumerator (38.0) -
Enumerator.new(self, method, *args) を返します。
...# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (38.0) -
Enumerator.new(self, method, *args) を返します。
...# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)... -
Object
# to _ proc -> Proc (26.0) -
オブジェクトの Proc への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...すが、
このメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。
//emlist[][ruby]{
def doing
yield
end
class Foo
def to_proc
Proc.new{p 'ok'}
end
end
it = Foo.new
doing(&it) #=> "ok"
//}...