|
NAMEVenus::Role::Assertable - Assertable Role ABSTRACTAssertable Role for Perl 5 SYNOPSIS package Example;
use Venus::Class;
use Venus::Assert;
with 'Venus::Role::Assertable';
sub assertion {
Venus::Assert->new('Example')->accept('Example')
}
package main;
my $example = Example->new;
# $example->check;
DESCRIPTIONThis package modifies the consuming package and requires methods for making the object assertable. METHODSThis package provides the following methods: assertassert(any $data) (any) The assert method returns the data provided if it passes the registered type constraints, or throws an exception. Since 1.23
assertionassertion() (Venus::Assert) The assertion method receives no arguments and should returns a Venus::Assert object. Since 1.23
checkcheck(any $data) (boolean) The check method returns true if the data provided passes the registered type constraints, or returns false. Since 1.23
coercecoerce(any $data) (any) The coerce method returns a coerced value if the data provided matches any of the registered type coercions, or returns the data provided. Since 1.23
makemake(any $data) (object) The make method returns an instance of the invocant, if the data provided passes the registered type constraints, allowing for any coercion, or throws an exception. If the data provided is itself an instance of the invocant it will be returned unaltered. Since 1.23
AUTHORSAwncorp, "awncorp@cpan.org" LICENSECopyright (C) 2022, Awncorp, "awncorp@cpan.org". This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.
|