Sha256: d82decf172e74442f5c66f705ed5c139a24063d4464a2b812faa4b0e87e2d6f5

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

module Substation
  module Processor

    # A processor to evaluate a chain's request input data
    class Evaluator

      include Incoming
      include Concord.new(:handler)

      # Evaluate a chain's request input data
      #
      # @param [Request] request
      #   the request to process
      #
      # @return [Response]
      #
      # @api private
      def call(request)
        result = handler.call(request.input)
        output = result.output
        if result.success?
          request.success(output)
        else
          request.error(output)
        end
      end

    end # class Evaluator
  end # module Processor
end # module Substation

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
substation-0.0.8 lib/substation/processor/evaluator.rb