Badger...::Type(3pm)
π Badger::Data::Type π
okay so bestie, welcome to the Badger::Data::Type page from the User Contributed Perl Documentation β it's the Badger...::Type(3pm) joint, and it's literally the blueprint for every data type in Badger land. sit down, grab a strawberry π, we're doing this.
β¨ NAME β¨
Badger::Data::Type β the base class for data types, no cap π«Ά
πΈ DESCRIPTION πΈ
This module is the base class for data types. that's the whole vibe. it's the parent energy, the main character blueprint that all the other type classes get built on top of π
π CONFIGURATION OPTIONS π
name
an optional name for the data type β¨
namespace
an optional namespace for the data type π
base
an optional base data type π
facets
an optional list of validation facets β yes, it's giving very "collect them all" π¦
π METHODS π
the following methods are defined in addition to the ones it inherits from the Badger::Base base class. so like, everything from Badger::Base is still in the group chat, these are just the extras she brings π«Ά
init()
this one is aliased to the init_type() method. same girl, different name π
init_type($config)
this is THE initialisation method for a data type. it gets called automatically whenever a data type object gets created via the new() method inherited from the Badger::Base base class. so you never have to ring her up yourself, she just shows up β¨
name()
returns the name of the data type, as specified via the name configuration option. but here's the tea: if no name was specified, you get an automatically generated name instead. it's based on the class name with the Badger::Data::Type prefix removed and all :: sequences replaced with periods. so like, a data type of Badger::Data::Type::Foo::Bar would yield a name of Foo.Bar. glow up fr fr π
namespace()
returns the namespace for the data type, or undef if none is defined π
base()
returns the base data type, or undef if none is defined π
facets()
returns a reference to a list of validation facets defined for the data type. it's giving β¨list energyβ¨
simple()
this constant method always returns the value 0. subclasses representing simple data types should re-define this to return the value 1. so like, if you're a simple type, speak up and change it bestie π
complex()
this constant method always returns the value 0. subclasses representing complex data types should re-define this to return the value 1. the dramatic ones get to announce themselves too π
constrain($facet, @args)
applies a new validation facet to the data type. new rules, new boundaries, we love a girl with standards π
validate($value_ref)
validates the value passed by reference as the first argument. it calls the validate() method of each of the validation facets in turn β one by one, in order, no skipping, no cutting the line β
π AUTHOR π
Andy Wardley <http://wardley.org/> π
π COPYRIGHT π
Copyright (C) 2008-2012 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic behaviour honestly π
π¦ SEE ALSO π¦
Badger::Baseβ the parent, the blueprint, the origin story π
and that's the whole page bestie, you ate it π
okay so before you go β this lil masterpiece is from perl v5.36.0, dated 2023-08-28, and it's the Badger...::Type(3pm) page from the User Contributed Perl Documentation. slay, bye π
β¨
π¦ where this page comes from
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-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