るりまサーチ (Ruby 3.3)

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

別のキーワード

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

ライブラリ

検索結果

SingleForwardable (114127.0)

オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。

オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。

=== 使い方

オブジェクトに対して extend して使います。

例:

require 'forwardable'
g = Goo.new
g.extend SingleForwardable
g.def_delegator("@out", :puts)
g.puts ...

また、SingleForwardable はクラスやモジュールに対して以下のようにする事もできます。

require 'forwardable'
class Implementation
def self....