Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > delegateライブラリ > Delegatorクラス

class Delegator

クラスの継承リスト: Delegator < Object < Kernel

要約

サブクラスにメソッド委譲の仕組みを提供する抽象クラス。

メソッド委譲を行う場合は、本クラスを継承しDelegator#__getobj__を再定義する必要があります。

具体的な使用例については、SimpleDelegatorを参照してください。

インスタンスメソッド

定義 説明
__getobj__ -> object

委譲先のオブジェクトを返します。

marshal_dump -> object

シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。

marshal_load(obj) -> object

シリアライズされたオブジェクトから、Delegator#__getobj__ が返すオブジェクトを再現します。

method_missing(m, *args) -> object

渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。

respond_to?(m) -> bool

Delegator#__getobj__ が返すオブジェクトが メソッド m を持つとき真を返します。

定数

定義 説明
IgnoreBacktracePat -> Regexp

バックトレースで無視するパターンを返します。

継承したメソッド

== === =~ __id__ __send__ _dump class clone dclone display enum_for eql? equal? extend freeze frozen? hash initialize initialize_copy inspect instance_eval instance_exec instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? method methods nil? pretty_inspect pretty_print pretty_print_cycle pretty_print_inspect pretty_print_instance_variables private_methods protected_methods public_methods remove_instance_variable singleton_method_added singleton_method_removed singleton_method_undefined singleton_methods taint tainted? tap to_a to_ary to_hash to_int to_io to_proc to_regexp to_s to_str to_yaml to_yaml_properties to_yaml_style untaint .new