83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/setsuzoku/plugin.rb', line 83
def initialize(**options)
context = self.class.config_context || { name: 'Default plugin', service: {} }
self.name = context[:name]
service_config = context[:service].except(:type).merge({ plugin: self, credential: options[:credential] })
self.registered_instance = options[:registering_instance]
if context[:service] && context[:service][:type]
service = AVAILABLE_SERVICES[context[:service][:type]]
self.service = service.new(service_config)
end
self.config_context = context.merge(options.except(:registering_instance))
self
end
|