Module | Core::Interfaces::ServiceProvider |
In: |
core/interfaces.rb
|
The ServiceProviders are components that expose ‘services’ that other components of the application can use. Examples of providers:
interface elements (through the classes in Core::Model::Support)
different universes loaded
ServiceProvider implementations are located in the Core::ServiceProvider module
Service providers must take a variety of configuration parameters, for instance a :controller will point to the instantiatin controller and can be used by the provider to request services from other providers
# File core/interfaces.rb, line 134 def initialize(params={}) raise 'unimplemented!' end
Retrieve information of a specific service, this information includes a description and probably syntax specifications so the Controller can perform input validation before the request is transfered to the provider
# File core/interfaces.rb, line 153 def get_service_info(service_key) raise 'unimplemented!' end
Retrieve a list of all the services provided by this provider. The list consists of an array of service_key elements. This will be used by the Controller when a request for service is made to locate the right ServiceProvider to supply it.
# File core/interfaces.rb, line 140 def get_service_list() services = [] self.public_methods.each do |method| next unless method =~ /^service_/ services << $'.to_sym end return services end