Class: ServiceFlowRegistry
- Inherits:
-
Object
- Object
- ServiceFlowRegistry
- Defined in:
- app/lib/service_flow_registry.rb
Overview
A registry of ServiceFlow.
Class Attribute Summary collapse
-
.service_flows ⇒ Object
readonly
Returns the value of attribute service_flows.
Class Method Summary collapse
-
.flows(service) ⇒ Hash
Return all service flows for the given Service.
-
.load!(service, flow) ⇒ ServiceFlow
Load a ServiceFlow given the Service and flow.
Class Attribute Details
.service_flows ⇒ Object (readonly)
Returns the value of attribute service_flows.
19 20 21 |
# File 'app/lib/service_flow_registry.rb', line 19 def service_flows @service_flows end |
Class Method Details
.flows(service) ⇒ Hash
Return all service flows for the given Service.
26 27 28 |
# File 'app/lib/service_flow_registry.rb', line 26 def self.flows(service) @service_flows[service.name.to_sym] end |
.load!(service, flow) ⇒ ServiceFlow
Load a ServiceFlow given the Service and flow.
35 36 37 38 39 40 41 |
# File 'app/lib/service_flow_registry.rb', line 35 def self.load!(service, flow) service_flow = @service_flows.dig(service.name.to_sym, flow) raise Exceptions::MissingServiceFlowError, "Service #{service.name} missing #{flow} flow" if service_flow.nil? service_flow.new(service) end |