Forwardable

Forwardable

ri

 ----------------------------------------------------- Class: Forwardable
      The Forwardable module provides delegation of specified methods to
      a designated object, using the methods #def_delegator and
      #def_delegators.
 
      For example, say you have a class RecordCollection which contains
      an array  @records . You could provide the lookup method
      #record_number(), which simply calls #[] on the  @records  array,
      like this:
 
        class RecordCollection
          extends Forwardable
          def_delegator :@records, :[], :record_number
        end
 
      Further, if you wish to provide the methods #size, #<<, and #map,
      all of which delegate to @records, this is how you can do it:
 
        class RecordCollection
          # extends Forwardable, but we did that above
          def_delegators :@records, :size, :<<, :map
        end
 
      Also see the example at forwardable.rb.
 
 ------------------------------------------------------------------------
 
 
 Instance methods:
 -----------------
      def_delegator, def_delegators, def_instance_delegator,
      def_instance_delegators
 
 Attributes:
      debug

refe

 ==== Forwardable ====
 詳細は
 forwardable.rd.ja
 を参照
 ---- Singleton methods ----
 ---- Instance methods ----
 ---- Singleton methods (inherited) ----
 ---- Instance methods (inherited) ----