Badger...::Type(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute

πŸ’– 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 (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