![]() |
![]()
| ![]() |
![]()
NAMESQL::Translator::Types - Type checking functions SYNOPSISpackage Foo; use Moo; use SQL::Translator::Types qw(schema_obj enum); has foo => ( is => 'rw', isa => schema_obj('Trigger') ); has bar => ( is => 'rw', isa => enum([qw(baz quux quuz)], { msg => "Invalid value for bar: '%s'", icase => 1, }); DESCRIPTIONSThis module exports functions that return coderefs suitable for Moo "isa" type checks. Errors are reported using "throw" in SQL::Translator::Utils. FUNCTIONSschema_obj($type)Returns a coderef that checks that its arguments is an object of the class "SQL::Translator::Schema::$type". enum(\@strings, [$msg | \%parameters])Returns a coderef that checks that the argument is one of the provided @strings. Parameters
|