るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.036秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.5.0[x] > クエリ:map[x] > クエリ:new[x] > 種類:クラス[x]

別のキーワード

  1. matrix map
  2. _builtin map
  3. matrix map!
  4. _builtin flat_map
  5. set map!

キーワード

検索結果

Thread::Backtrace::Location (82.0)

Ruby のフレームを表すクラスです。

...例1の実行結果:

caller_locations.rb:2:in `a'
caller_locations.rb:5:in `b'
caller_locations.rb:8:in `c'

//emlist[例2][ruby]{
# foo.rb
class
Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
p...

Enumerator (64.0)

each 以外のメソッドにも Enumerable の機能を提供するためのラッパークラスです。 また、外部イテレータとしても使えます。

each 以外のメソッドにも Enumerable の機能を提供するためのラッパークラスです。
また、外部イテレータとしても使えます。

Enumerable モジュールは、 Module#include 先のクラスが持つ
each メソッドを元に様々なメソッドを提供します。
例えば Array#map は Array#each の繰り返しを元にして定義されます。
Enumerator を介することにより String#each_byte のような
異なる名前のイテレータについても each と同様に Enumerable の機能を利用できます。

Enumerator を生成するには Enu...