Module: Fathom::Plugins

Included in:
Definition, Edge, Network, NetworkPopulation, Outcome, Property, Variable
Defined in:
lib/fathom/behaviors/plugins.rb

Instance Method Summary collapse

Instance Method Details

#plugin(mod) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/fathom/behaviors/plugins.rb', line 7

def plugin(mod)
  include mod unless mod.const_defined?(:InstanceMethods)
  extend mod::ClassMethods if mod.const_defined?(:ClassMethods)
  include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
  mod.configure(self) if mod.respond_to?(:configure)
  plugins << mod
end

#pluginsObject



3
4
5
# File 'lib/fathom/behaviors/plugins.rb', line 3

def plugins
  @plugins ||= []
end