Class: Edi::NullProcessor

Inherits:
BaseService show all
Defined in:
app/services/edi/null_processor.rb

Overview

Service object: null processor.

Instance Attribute Summary collapse

Attributes inherited from BaseService

#options

Instance Method Summary collapse

Methods inherited from BaseService

#log_debug, #log_error, #log_info, #log_warning, #logger, #tagged_logger

Constructor Details

#initialize(orchestrator, processor_type, options = {}) ⇒ NullProcessor

Returns a new instance of NullProcessor.



8
9
10
11
12
# File 'app/services/edi/null_processor.rb', line 8

def initialize(orchestrator, processor_type, options = {})
  @orchestrator = orchestrator
  @processor_type = processor_type
  super(options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(_meth, *_args) ⇒ Object



20
21
22
23
# File 'app/services/edi/null_processor.rb', line 20

def method_missing(_meth, *_args)
  # Do nothing
  logger.info "Processor #{processor_type} not defined for #{orchestrator.partner}"
end

Instance Attribute Details

#orchestratorObject (readonly)

Returns the value of attribute orchestrator.



6
7
8
# File 'app/services/edi/null_processor.rb', line 6

def orchestrator
  @orchestrator
end

#processor_typeObject (readonly)

Returns the value of attribute processor_type.



6
7
8
# File 'app/services/edi/null_processor.rb', line 6

def processor_type
  @processor_type
end

Instance Method Details

#process(*_args) ⇒ Object

Retrieves messages according to the partner config



15
16
17
18
# File 'app/services/edi/null_processor.rb', line 15

def process(*_args)
  # Do nothing
  logger.debug("Processor not defined", processor_type: processor_type, partner: orchestrator.partner)
end