Sha256: c76854791939d7e98d616a6832b70c98b9c2ab4bff6c10be0ffcc6e8a7822dd6
Contents?: true
Size: 447 Bytes
Versions: 10
Compression:
Stored size: 447 Bytes
Contents
module Compel class Result attr_reader :value, :errors def initialize(validator) @valid = validator.valid? @value = validator.serialize @errors = validator.serialize_errors end def valid? @valid end def raise? if !valid? exception = InvalidObjectError.new exception.object = value raise exception, 'object has errors' end value end end end
Version data entries
10 entries across 10 versions & 1 rubygems