Class: ServiceRunner
- Inherits:
-
Object
- Object
- ServiceRunner
- Defined in:
- lib/edi/service_runner.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(message:) ⇒ ServiceRunner
constructor
A new instance of ServiceRunner.
Constructor Details
#initialize(message:) ⇒ ServiceRunner
Returns a new instance of ServiceRunner.
4 5 6 |
# File 'lib/edi/service_runner.rb', line 4 def initialize(message:) @message = end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/edi/service_runner.rb', line 3 def @message end |
#service ⇒ Object
Returns the value of attribute service.
3 4 5 |
# File 'lib/edi/service_runner.rb', line 3 def service @service end |
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/edi/service_runner.rb', line 8 def execute self.service = EDI::Interpreter.new().determine_service.new() EDI::Logger.info "Service: #{service.class} invoked" begin _run_service rescue EDI::UnfitEnvironmentException => e EDI::ArrayResponder.new(EDI.config.unfit_environment_response).respond rescue EDI::ThirdPartyAPIFailure EDI::ArrayResponder.new(EDI.config.third_party_api_failure_respone).respond rescue => e EDI::ArrayResponder.new(EDI.config.standard_error_response).respond end end |