Sha256: 45606f84a04c28bd1461a6501155407e475620c536c6c5b44b5a994d46862b5f
Contents?: true
Size: 1.26 KB
Versions: 27
Compression:
Stored size: 1.26 KB
Contents
module Foobara module BuiltinTypes module Attributes module SupportedTransformers class Defaults < Value::Transformer module TypeDeclarationExtension module ExtendAttributesTypeDeclaration module TypeDeclarationValidators class HashWithSymbolicKeys < TypeDeclarations::TypeDeclarationValidator class InvalidDefaultValuesGivenError < Value::DataError class << self def message "Defaults should be a hash with symbolic keys" end end end def applicable?(strict_type_declaration) strict_type_declaration.is_a?(Hash) && strict_type_declaration.key?(:defaults) end def validation_errors(strict_type_declaration) defaults = strict_type_declaration[:defaults] unless defaults.is_a?(Hash) && Util.all_symbolic_keys?(defaults) build_error(context: { attribute_name: :defaults, value: defaults }) end end end end end end end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems