Tangen...::Class(3pm)
π Tangence::Meta::Class π
okay bestie, so this is the manual page for Tangence::Meta::Class β it lives in the Perl docs, section 3pm, and it's giving very "I am the blueprint" energy. pull up a chair π«Ά
β¨ NAME β¨
Tangence::Meta::Class β a whole data structure representing one Tangence class. yeah. one (1) class. it's the little container that knows everything about a class, and no cap, it does a lot for something so small.
πΈ DESCRIPTION πΈ
okay so picture this: this data structure object stores all the info about one Tangence class. that's its whole job and it's iconic for it. π
and here's the part that matters β once you've constructed it and defined it, these objects are immutable. like, frozen. locked in. no take-backs, no edits, no "wait actuallyβ". they are who they are. periodt. π
π CONSTRUCTOR π
new
$class = Tangence::Meta::Class->new( name => $name )
returns you a brand new instance representing the name you handed it. baby class, freshly born, zero definition yet. π¦
define
$class->define( %args )
this is the glow-up moment β it provides a definition for the class. here's what you can pass in:
methods => HASHβ optional HASH reference stuffed with metadata about methods, as instances ofTangence::Meta::Method. π§events => HASHβ optional HASH reference containing metadata about events, as instances ofTangence::Meta::Event.properties => HASHβ optional HASH reference containing metadata about properties, as instances ofTangence::Meta::Property.superclasses => ARRAYβ optional ARRAY reference holding your superclasses asTangence::Meta::Classreferences. it's giving family tree π
lowkey important: all three ofmethods,eventsandpropertiesare optional HASH references, and they're described together as carrying metadata about methods, events and properties as instances ofTangence::Meta::Method,Tangence::Meta::EventorTangence::Meta::Property. so you can show up with none of them. no pressure bestie π
π₯ ACCESSORS π₯
defined
$defined = $class->defined
returns true if a definition for the class has been provided using define. basically the "have you actually done the thing yet" check. vibe check: passed or not. β
name
$name = $class->name
returns the name of the class. yeah that's it, that's the tweet. π
perlname
$perlname = $class->perlname
returns the perl name of the class. and the way this works is so cute: it's the Tangence name, except every dot gets replaced by double colons (::). so dots become :: and now Perl can actually read it. slay. π
direct_superclasses
@superclasses = $class->direct_superclasses
returns the direct superclasses, as a list of Tangence::Meta::Class references. direct = the ones right above you, not the whole ancestry. just your immediate parents, not your whole family reunion. π
direct_methods
$methods = $class->direct_methods
returns the methods that this class directly defines β as in, the ones it wrote itself, rather than inheriting them from superclasses β as a HASH reference mapping names to Tangence::Meta::Method instances. π§
direct_events
$events = $class->direct_events
returns the events that this class directly defines (again, not the inherited ones) as a HASH reference mapping names to Tangence::Meta::Event instances. π£
direct_properties
$properties = $class->direct_properties
returns the properties that this class directly defines (not inherited, we said what we said) as a HASH reference mapping names to Tangence::Meta::Property instances. π
π AGGREGATE ACCESSORS π
okay so these ones are the main character accessors β they don't just look at this one class, they inspect the full inheritance tree of this class and all its superclasses. the whole lineage. the entire family group chat. π«Ά
superclasses
@superclasses = $class->superclasses
returns all the superclasses, as a list of unique Tangence::Meta::Class references. unique is the key word β nobody's showing up twice. β
methods
$methods = $class->methods
returns all the methods available to this class as a HASH reference mapping names to Tangence::Meta::Method instances. everything you can call, all in one place. π₯
method
$method = $class->method( $name )
returns the named method as a Tangence::Meta::Method instance β or undef if no such method exists. so if it's not there, you get nothing, not an error. undef, bestie. π
events
$events = $class->events
returns all the events available to this class as a HASH reference mapping names to Tangence::Meta::Event instances. the full guest list. π
event
$event = $class->event( $name )
returns the named event as a Tangence::Meta::Event instance, or undef if no such event exists. same deal as method. π
properties
$properties = $class->properties
returns all the properties available to this class as a HASH reference mapping names to Tangence::Meta::Property instances. every last one. π
property
$property = $class->property( $name )
returns the named property as a Tangence::Meta::Property instance, or undef if no such property exists. if it's missing, it's missing, and you get undef to prove it. π
π AUTHOR π
this absolute legend wrote it:
Paul Evans <leonerd@leonerd.org.uk>
and that's the whole page bestie!! π¦β¨ this one's from the User Contributed Perl Documentation, version perl v5.40.0, dated 2024-09-13 β so go forth, represent your classes, and remember: once it's defined, it's immutable, so make it count. mwah π
π
π¦ where this page comes from
- ubuntu resolute: libtangence-perl 0.33-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtangence-perl 0.33-1 Β· 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