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
- #config ⇒ Object
- #default_options(options) ⇒ Object
- #register_as(name) ⇒ Object
- #service_extension(extension) ⇒ Object
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
#config ⇒ Object
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 () config[:default_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 |