Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

moosex::types::base(3pm) [mojave man page]

MooseX::Types::Base(3pm)				User Contributed Perl Documentation				  MooseX::Types::Base(3pm)

NAME
MooseX::Types::Base - Type library base class VERSION
version 0.41 DESCRIPTION
You normally won't need to interact with this class by yourself. It is merely a collection of functionality that type libraries need to interact with moose and the rest of the MooseX::Types module. METHODS
import Provides the import mechanism for your library. See "LIBRARY USAGE" in MooseX::Types for syntax details on this. get_type This returns a type from the library's store by its name. type_names Returns a list of all known types by their name. add_type Adds a new type to the library. has_type Returns true or false depending on if this library knows a type by that name. type_storage Returns the library's type storage hash reference. You shouldn't use this method directly unless you know what you are doing. It is not an internal method because overriding it makes virtual libraries very easy. registered_class_types Returns the class types registered within this library. Don't use directly. register_class_type Register a "class_type" for use in this library by class name. get_registered_class_type Get a "class_type" registered in this library by name. registered_role_types Returns the role types registered within this library. Don't use directly. register_role_type Register a "role_type" for use in this library by role name. get_registered_role_type Get a "role_type" registered in this library by role name. SEE ALSO
MooseX::Types::Moose LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as perl itself. AUTHOR
Robert "phaylon" Sedlacek <rs@474.at> COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-12-21 MooseX::Types::Base(3pm)

Check Out this Related Man Page

MooseX::Types::VariantTable(3pm)			User Contributed Perl Documentation			  MooseX::Types::VariantTable(3pm)

NAME
MooseX::Types::VariantTable - Type constraint based variant table SYNOPSIS
# see also MooseX::Types::VariantTable::Declare for a way to # declare variant table based methods use MooseX::Types::VariantTable; my $dispatch_table = MooseX::Types::VariantTable->new( variants => [ { type => "Foo", value => &foo_handler }, { type => "Bar", value => &bar_handler }, { type => "Item", value => &fallback }, ], ); # look up the correct handler for $thingy based on the type constraints it passes my $entry = $dispatch_table->find_variant($thingy); # or use the 'dispatch' convenience method if the entries are code refs $dispatch_table->dispatch( $thingy, @args ); DESCRIPTION
This object implements a simple dispatch table based on Moose type constraints. Subtypes will be checked before their parents, meaning that the order of the declaration does not matter. This object is used internally by Moose::Meta::Method::VariantTable and MooseX::Types::VariantTable::Declare to provide primitive multi sub support. ATTRIBUTES
ambigious_match_callback A code reference that'll be executed when find_variant found more than one matching variant for a value. It defaults to something that simply croaks with an error message like this: Ambiguous match %s where %s contains a list of stringified types that matched. METHODS
new add_variant $type, $value Registers $type, such that $value will be returned by "find_variant" for items passing $type. Subtyping is respected in the table. find_variant $value Returns the registered value for the most specific type that $value passes. dispatch $value, @args A convenience method for when the registered values are code references. Calls "find_variant" and if the result is a code reference, it will "goto" this code reference with the value and any additional arguments. has_type $type Returns true if an entry for $type is registered. has_parent $type Returns true if a parent type of $type is registered. TODO
The meta method composes in multiple inheritence but not yet with roles due to extensibility issues with the role application code. When Moose::Meta::Role can pluggably merge methods variant table methods can gain role composition. AUTHOR
Yuval Kogman <nothingmuch@woobling.org> Florian Ragwitz <rafl@debian.org> COPYRIGHT
Copyright (c) 2008 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2011-02-27 MooseX::Types::VariantTable(3pm)
Man Page