Sha256: 30cf332c52990a0534fc91b3c284216922e732165cb1b2557b6a0949cc827c9e
Contents?: true
Size: 363 Bytes
Versions: 1
Compression:
Stored size: 363 Bytes
Contents
module MiniCamel module Processor class Validate < Base values do attribute :field, Symbol attribute :message, String attribute :raise_error, Class end def call(exchange) value = exchange.context_fetch(field) raise raise_error.new(message, value) if value.invalid? 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/validate.rb |