Module: KingSoa
- Defined in:
- lib/king_soa.rb,
lib/king_soa/service.rb,
lib/king_soa/registry.rb
Defined Under Namespace
Modules: Rack Classes: Registry, Service
Class Method Summary collapse
-
.find(service) ⇒ Object
- Locate service by a given name: KingSoa.find(:my_service_name) ==== Parameter service<String|Symbol>
-
the name to lookup.
-
.method_missing(meth, *args, &blk) ⇒ Object
This is where the services get called.
Class Method Details
.find(service) ⇒ Object
Locate service by a given name:
KingSoa.find(:my_service_name)
Parameter
- service<String|Symbol>
-
the name to lookup
22 23 24 |
# File 'lib/king_soa.rb', line 22 def find(service) Registry[service] end |
.method_missing(meth, *args, &blk) ⇒ Object
This is where the services get called. Tries to locate the service in the registry and if found call its perform method
29 30 31 32 33 34 35 |
# File 'lib/king_soa.rb', line 29 def method_missing(meth, *args, &blk) # :nodoc: if service = Registry[meth] service.perform(*args) else super(meth, *args, &blk) end end |