Changeset 366 for lang/ruby/module-pluggable
- Timestamp:
- 10/05/07 00:09:09 (4 years ago)
- Location:
- lang/ruby/module-pluggable
- Files:
-
- 2 modified
-
README (modified) (1 diff)
-
examples/simple.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/module-pluggable/README
r355 r366 2 2 =========================== 3 3 4 atodekaku 4 see examples. -
lang/ruby/module-pluggable/examples/simple.rb
r357 r366 4 4 5 5 class 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. 6 14 pluggable 7 15 8 16 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)'. 9 20 plugins.init(self) 10 21 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)