lib/jidoka/validatable.rb
# Iterate through `argument_types` checking for a class match
Iterate through `argument_types` checking for a class match
Iterate through ` argument_types ` checking for a class match
def validate_arguments!(**args)
        return if self.class.argument_types.nil?
        self.class.argument_types.each do |key, klass|
          case args[key]
          when *Array(klass).map(&:constantize) then nil 
          else raise ArgumentClassMismatch.new(key, expected: klass, actual: args[key]&.class&.to_s)
          end
        end
      end
def validate_arguments! ( ** args ) return if self . class . argument_types . nil? self . class . argument_types . each do | key , klass | case args [ key ] when * Array ( klass ) . map ( & :constantize ) then nil else raise ArgumentClassMismatch . new ( key , expected : klass , actual : args [ key ] &. class &. to_s ) end end end
Iterate through `argument_types` checking for a class match
Iterate through ` argument_types ` checking for a class match
# Object is okay
args
<not_specific>