Sha256: a944021522e2590c74afb09064161ac87628935bacf74f003071a3585f80fb74

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

module MiniCamel
  module ProcessorDefinition
    class ExposeField < Base

      values do
        attribute :field, Symbol
        validates :field, presence: true

        attribute :from, Symbol
        validates :from, presence: true

        attribute :as, Symbol, default: :default_as
        validates :as, presence: true
      end

      def generate_processor(env)
        Processor::ExposeField.new(env: env, field: field, from: from, as: as)
      end

      private

      def default_as
        field
      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_definition/expose_field.rb