1Declare::Constraints::SUismeprleC:o:nLtirbirbauDrteyec:dl:aOPrOee(r:3l:)CDooncsutmreanitnattsi:o:nSimple::Library::OO(3)
2
3
4
6 Declare::Constraints::Simple::Library::OO - OO Constraints
7
9 # accept objects or classes
10 my $object_or_class = Or( IsObject, IsClass );
11
12 # valid on objects with all methods
13 my $proper_object = And( IsObject,
14 HasMethods( qw(foo bar) ));
15
16 # validate against date objects
17 my $is_date_object = IsA('DateTime');
18
20 This library contains the constraints for validating parameters in an
21 object oriented manner.
22
24 HasMethods(@methods)
25
26 Returns true if the value is an object or class that "can" all the
27 specified @methods.
28
29 The stack or path part of "HasMethods" looks like "HasMethods[$method]"
30 where $method is the first found missing method.
31
32 IsA(@classes)
33
34 Is true if the passed object or class is a subclass of one of the
35 classes mentioned in @classes.
36
37 IsClass()
38
39 Valid if value is a loaded class.
40
41 IsObject()
42
43 True if the value is blessed.
44
46 Declare::Constraints::Simple, Declare::Constraints::Simple::Library
47
49 Robert 'phaylon' Sedlacek "<phaylon@dunkelheit.at>"
50
52 This module is free software, you can redistribute it and/or modify it
53 under the same terms as perl itself.
54
55
56
57perl v5.8.8 2D0e0c6l-a0r9e-:1:1Constraints::Simple::Library::OO(3)