Show
Ignore:
Timestamp:
10/05/07 00:09:09 (4 years ago)
Author:
cho45
Message:

lang/ruby/module-pluggable/README,
lang/ruby/module-pluggable/examples/simple.rb:

めんどいので example 補充

Location:
lang/ruby/module-pluggable
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/module-pluggable/README

    r355 r366  
    22=========================== 
    33 
    4 atodekaku 
     4see examples. 
  • lang/ruby/module-pluggable/examples/simple.rb

    r357 r366  
    44 
    55class SimplePluggable 
     6        # pluggable [name=:plugins] [opts] 
     7        # pluggable make the name of instance method 
     8        # returning instance of Module::Pluggable::Plugin. 
     9        # 
     10        # All loaded plugins are in anonymous module, 
     11        # so you can't access the classes directly, 
     12        # and you can create some plugin-sets 
     13        # without confusing class variables etc. 
    614        pluggable 
    715 
    816        def initialize 
     17                # `init' method is not defined on Module::Pluggable::Plugin. 
     18                # undefined methods are delegated to `call' the plugins. 
     19                # In this case, `plugins.init(self)' is same as `plugins.call(:init, self)'. 
    920                plugins.init(self) 
    1021        end