Module: RubyHooks::Extensible
- Included in:
- Hook
- Defined in:
- lib/ruby-hooks/extensible.rb
Overview
Allow extending object with plugins(modules)
Instance Method Summary collapse
-
#add_plugins(method, plugins = nil) ⇒ Object
handle single parameters as well as arrays of params.
Instance Method Details
#add_plugins(method, plugins = nil) ⇒ Object
handle single parameters as well as arrays of params
15 16 17 18 19 20 21 |
# File 'lib/ruby-hooks/extensible.rb', line 15 def add_plugins(method, plugins = nil) case plugins when Array then plugins.each { |plugin| send(method, plugin) } when nil then true else send(method, plugins) end end |