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.

Parameters:

  • orchestrator (Edi::BaseOrchestrator)

    the partner orchestrator

  • processor_type (Symbol, String)

    the processor type that is not defined

  • options (Hash) (defaults to: {})

    service options (passed to BaseService)

Options Hash (options):

  • logger (Logger)

    logger to use (defaults to Rails.logger)



12
13
14
15
16
# File 'app/services/edi/null_processor.rb', line 12

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



24
25
26
27
# File 'app/services/edi/null_processor.rb', line 24

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



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

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