Class: Hoth::ServiceDefinition
- Inherits:
-
Object
- Object
- Hoth::ServiceDefinition
- Defined in:
- lib/hoth/service_definition.rb
Instance Method Summary collapse
-
#service(service_name, &block) ⇒ Object
create a new service with service_name and register it at the ServiceRegistry.
Instance Method Details
#service(service_name, &block) ⇒ Object
create a new service with service_name and register it at the ServiceRegistry. The paramters of the block define the parameters of the defined service. Within the block you can describe the return value.
Example:
service :create_account do |account|
returns :account_id
end
14 15 16 |
# File 'lib/hoth/service_definition.rb', line 14 def service(service_name, &block) ServiceRegistry.add_service(Service.new(service_name, &block)) end |