9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/pathway.rb', line 9
def self.plugin(name)
require "pathway/plugins/#{Inflecto.underscore(name)}" if name.is_a?(Symbol)
plugin = name.is_a?(Module) ? name : Plugins.const_get(Inflecto.camelize(name))
self.extend plugin::ClassMethods if plugin.const_defined? :ClassMethods
self.include plugin::InstanceMethods if plugin.const_defined? :InstanceMethods
self::DSL.include plugin::DSLMethods if plugin.const_defined? :DSLMethods
plugin.apply(self) if plugin.respond_to?(:apply)
end
|