Module: Zen::Service::Plugins::Plugin

Included in:
Assertions, Attributes, Context, Executable, ExecutionCache, Policies, Rescue, Status, Validation
Defined in:
lib/zen/service/plugins/plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(plugin) ⇒ Object



6
7
8
9
10
# File 'lib/zen/service/plugins/plugin.rb', line 6

def self.extended(plugin)
  name = plugin.name.sub(/^.*::/, "").gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase.to_sym

  Service::Plugins.register(name, plugin)
end

Instance Method Details

#configObject



24
25
26
# File 'lib/zen/service/plugins/plugin.rb', line 24

def config
  @config ||= {}
end

#default_options(options) ⇒ Object



16
17
18
# File 'lib/zen/service/plugins/plugin.rb', line 16

def default_options(options)
  config[:default_options] = options
end

#register_as(name) ⇒ Object



12
13
14
# File 'lib/zen/service/plugins/plugin.rb', line 12

def register_as(name)
  Service::Plugins.register(name, self)
end

#service_extension(extension) ⇒ Object



20
21
22
# File 'lib/zen/service/plugins/plugin.rb', line 20

def service_extension(extension)
  ::Zen::Service.send(:extend, extension)
end