るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.075秒)

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. range end

ライブラリ

キーワード

検索結果

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"
//}...

絞り込み条件を変える