Sha256: dd4ec4b40ea5bba8c288f86f96a63c4a12bf2162f00cd12b5dbf1076649239e3

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

module MiniCamel
  module Processor
    class Process < Base

      values do
        attribute :fields, [Symbol]
        attribute :with_class, Class
      end

      def call(exchange)
        with_class.new(visible_fields(exchange)).call
      end

      private

      def visible_fields(exchange)
        fields.map{|f| {f => exchange.context_fetch(f)}}.reduce(&:merge)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mini_camel-0.5.8 lib/mini_camel/processor/process.rb