Class:...Numeric(3pm)

πŸ“¦
version 0.66 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– 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 with Class::Meta.
  • Class::Meta::Type β€” this class manages the creation of data types.
  • Class::Meta::Attribute β€” this class manages Class::Meta class attributes, all of which are based on data types.

other data type modules:

  • Class::Meta::Types::Perl
  • Class::Meta::Types::String
  • Class::Meta::Types::Boolean

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