Module: T::Props::TypeValidation::DecoratorMethods
- Extended by:
- Sig
- Defined in:
- lib/types/props/type_validation.rb
Instance Method Summary collapse
Methods included from Sig
Instance Method Details
#prop_validate_definition!(name, _cls, rules, type) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/types/props/type_validation.rb', line 28 def prop_validate_definition!(name, _cls, rules, type) super if !rules[:DEPRECATED_underspecified_type] && !(type.singleton_class <= T::Props::CustomType) validate_type(type, field_name: name) elsif rules[:DEPRECATED_underspecified_type] && find_invalid_subtype(type).nil? raise ArgumentError.new("DEPRECATED_underspecified_type set unnecessarily for #{@class.name}.#{name} - #{type} is a valid type") end end |
#valid_props ⇒ Object
15 16 17 |
# File 'lib/types/props/type_validation.rb', line 15 def valid_props super + [:DEPRECATED_underspecified_type] end |