Module: Wonkavision::Plugins
- Defined in:
- lib/wonkavision/plugins.rb,
lib/wonkavision/plugins/timeline.rb,
lib/wonkavision/plugins/callbacks.rb,
lib/wonkavision/plugins/event_handling.rb,
lib/wonkavision/plugins/analytics/facts.rb,
lib/wonkavision/plugins/business_activity.rb,
lib/wonkavision/plugins/analytics/aggregation.rb,
lib/wonkavision/plugins/analytics/aggregation/measure.rb,
lib/wonkavision/plugins/analytics/aggregation/attribute.rb,
lib/wonkavision/plugins/analytics/aggregation/dimension.rb,
lib/wonkavision/plugins/business_activity/event_binding.rb,
lib/wonkavision/plugins/analytics/aggregation/aggregation_spec.rb
Defined Under Namespace
Modules: Aggregation, BusinessActivity, Callbacks, EventHandling, Facts, Timeline
Instance Method Summary
collapse
Instance Method Details
#ensure_wonkavision_plugin(plugin, option = {}) ⇒ Object
16
17
18
|
# File 'lib/wonkavision/plugins.rb', line 16
def ensure_wonkavision_plugin(plugin,option={})
use(plugin,options) unless has_wonkavision_plugin?(plugin)
end
|
#has_wonkavision_plugin?(plugin) ⇒ Boolean
12
13
14
|
# File 'lib/wonkavision/plugins.rb', line 12
def has_wonkavision_plugin?(plugin)
wonkavision_plugins.detect{|p|p==plugin}
end
|
#plug(mod, options = {}) ⇒ Object
Also known as:
use
20
21
22
23
24
25
26
27
|
# File 'lib/wonkavision/plugins.rb', line 20
def plug(mod,options={})
extend mod::ClassMethods if mod.const_defined?(:ClassMethods)
include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
extend mod::Fields if mod.const_defined?(:Fields)
include mod::Fields if mod.const_defined?(:Fields)
mod.configure(self,options) if mod.respond_to?(:configure)
wonkavision_plugins << mod
end
|
#wonkavision_plugins ⇒ Object
8
9
10
|
# File 'lib/wonkavision/plugins.rb', line 8
def wonkavision_plugins
@wonkavision_plugins ||= []
end
|