Declare::Constraints::Simple::Library::OO - OO Constraints
# accept objects or classes my $object_or_class = Or( IsObject, IsClass ); # valid on objects with all methods my $proper_object = And( IsObject, HasMethods( qw(foo bar) )); # validate against date objects my $is_date_object = IsA('DateTime');
This library contains the constraints for validating parameters in an object oriented manner.
Returns true if the value is an object or class that
can all the specified
The stack or path part of
HasMethods looks like
$method is the first found missing method.
Is true if the passed object or class is a subclass of one of the classes mentioned in
Valid if value is a loaded class.
True if the value is blessed.
Robert 'phaylon' Sedlacek
This module is free software, you can redistribute it and/or modify it under the same terms as perl itself.