Class: Hoth::ServiceDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/hoth/service_definition.rb

Instance Method Summary collapse

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 ||
  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