Sha256: 543ae49d35f00d30242176deab29c8a9c1dfdc1375a9351d07bf4f5ba5657c77
Contents?: true
Size: 579 Bytes
Versions: 6
Compression:
Stored size: 579 Bytes
Contents
# frozen_string_literal: true # Main Gem module module CodeBrkrGameTraining # Data validation module module Validator DataValidError = Class.new(StandardError) def check_type(data, check_type) raise DataValidError, 'unexpected_type' unless data.instance_of? check_type end def check_length(data, check) raise DataValidError, 'unexpected_length' unless (check[:min]..check[:max]).cover? data.length end def check_contain_hash_key(val, hash) raise DataValidError, 'hash_key_not_found' unless hash.key? val.to_sym end end end
Version data entries
6 entries across 6 versions & 1 rubygems