Class:...Numeric(3pm)
π Class::Meta::Types::Numeric β the numeric data types page π
okay bestie, this is the manual page for Class::Meta::Types::Numeric, and it's part of the User Contributed Perl Documentation collection. yes it's giving very niche, but it's also giving essential, so let's go β¨
π NAME π
Class::Meta::Types::Numeric β Numeric data types π
β¨ SYNOPSIS β¨
here's the vibe, copy-paste it exactly bestie, no cap:
package MyApp::Thingy;
use strict;
use Class::Meta;
use Class::Meta::Types::Numeric;
# OR...
# use Class::Meta::Types::Numeric 'affordance';
# OR...
# use Class::Meta::Types::Numeric 'semi-affordance';
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => 'thingy' );
# Add an integer attribute.
$cm->add_attribute( name => 'age',
type => 'integer' );
$cm->build;
}
πΈ DESCRIPTION πΈ
so this module is literally the plug for numeric data types that play nice with Class::Meta attributes. you load it, then you pass the name of one of its types to the add_attribute() method of a Class::Meta object, and boom β you've got yourself an attribute of the numeric data type. π«Ά
want more on how to use and create data types generally? go read Class::Meta::Type, that's your girl.
the validation checks for Class::Meta::Types::Numeric? those come courtesy of the Data::Types module. so if you're wondering what it counts as a number and what it's side-eyeing and rejecting, consult its documentation. π
here are the data types this module creates, in order:
wholeβ a whole number. that's a positive integer, periodt.integer,intβ an integer number.decimal,decβ a decimal number.realβ a real number.floatβ a floating point number.
π¦ SUPPORT π¦
this module lives in an open GitHub repository over at http://github.com/theory/class-meta/. feel free to fork it and contribute, bestie β the doors are open! π
got bugs? file them via GitHub Issues at http://github.com/theory/class-meta/issues/, or send mail to bug-Class-Meta@rt.cpan.org <mailto:bug-Class-Meta@rt.cpan.org>.
π AUTHOR π
David E. Wheeler <david@justatheory.com> β an icon, honestly.
π SEE ALSO π
other classes of interest within the Class::Meta distribution include:
Class::Metaβ this class contains most of the documentation you need to get started withClass::Meta.Class::Meta::Typeβ this class manages the creation of data types.Class::Meta::Attributeβ this class managesClass::Metaclass attributes, all of which are based on data types.
other data type modules:
Class::Meta::Types::PerlClass::Meta::Types::StringClass::Meta::Types::Boolean
π COPYRIGHT AND LICENSE π
Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
so yeah, that's the whole page. go forth and type your numbers responsibly π
and a lil sign-off for the record: this was generated from perl v5.34.0, dated 2022-06-11, and it's filed under Class:...Numeric(3pm). slay, bye π§β¨
π¦ where this page comes from
- debian bookworm: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms