Export...e::Meta(3pm)

πŸ“¦
version 0.114 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Exporter::Declare::Meta β€” bestie, this is the meta object that keeps all the receipts (aka meta-data) for every exporter out there. πŸŽ€


✨ DESCRIPTION ✨

okay so listen. every single class that uses Exporter::Declare gets its own little Meta object assigned to it. it's giving personal assistant energy tbh. πŸ’…

and what does that Meta object do? it tracks all the available exports, tags, and options. that's it. that's the whole job. no cap. πŸ‘‘


🫢 METHODS 🫢

  • $class->new( $package ) β€” creates a meta object for the package you handed over. and the way that it also injects the export_meta() sub into that package's namespace so it returns the generated meta object?? iconic behaviour honestly. ✨
  • $class->new_from_exporter( $package ) β€” makes a meta object for a package that already uses Exporter.pm. heads up bestie, this will not turn the class into an Exporter::Declare package, but it will create a meta object and an export_meta() method on it. this one's mainly for reexport purposes. πŸ’œ
  • $package = $meta->package() β€” gets you the name of the package that this meta object is associated with. simple. clean. slay. 🌸
  • $meta->add_alias() β€” usually gets called at construction time to add a package alias function to the exports. lowkey a behind-the-scenes girly. πŸŽ€
  • $meta->add_export( $name, $ref ) β€” adds an export. $name should be the item name with sigil (and it's assumed to be a sub if there's no sigil, fyi). $ref should be a ref blessed as an Exporter::Declare::Export subclass. πŸ¦‹
  • $meta->get_export( $name ) β€” retrieves the Exporter::Declare::Export object by name. $name should be the item name with sigil, and again it's assumed to be sub when the sigil is missing. πŸ’«
  • $meta->export_tags_push( $name, @items ) β€” adds @items to the specified tag. the tag gets created if it doesn't already exist, no worries. $name should be the tag name WITHOUT the -/: prefix. ⭐
  • @list = $meta->export_tags_get( $name ) β€” gets the list of items associated with the specified tag. $name should be the tag name WITHOUT the -/: prefix. πŸ’–
  • @list = $meta->export_tags_list() β€” gets a list of all the export tags. the whole roster. πŸ“‹
  • $bool = $meta->is_tag( $name ) β€” checks if a tag with the given name exists. $name should be the tag name WITHOUT the -/: prefix. yes bestie, the prefix rule again. πŸŽ€
  • $meta->options_add( $name ) β€” adds import options by name. these are boolean options that take no arguments, so don't come for them with extra stuff. 🚫
  • my @list = $meta->options_list() β€” gets you the list of options. πŸ“
  • $meta->arguments_add( $name ) β€” adds import options that slurp in the next argument as a value. hungry little things fr fr. 😭
  • $bool = $meta->is_option( $name ) β€” checks if the specified name is an option. πŸ”
  • $bool = $meta->is_argument( $name ) β€” checks if the specified name is an option that takes an argument. πŸ’…
  • $meta->add_parser( $name, sub { ... } ) β€” adds a parser sub that should be associated with exports via Devel::Declare. 🧚
  • $meta->get_parser( $name ) β€” gets a parser by name. 🎯
  • $ref = $meta->get_ref_from_package( $item ) β€” returns a reference to a specific package variable or sub. πŸ‘‘
  • $meta->reexport( $package ) β€” re-exports the exports in the provided package. and plot twist, $package may be an Exporter::Declare based package or an Exporter based package. versatile queen. 🌈
  • $meta->merge( $meta2 ) β€” merges in the exports and tags of the second meta object. combining forces, bestie. 🀝

πŸ‘‘ AUTHORS πŸ‘‘

Chad Granum exodist7@gmail.com


Copyright (C) 2010 Chad Granum

Exporter-Declare is free software; Standard perl licence.

Exporter-Declare is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.


okay bestie that's the whole page, every last crumb of it, no crumbs left behind πŸ’€

and for the sign-off: this lil masterpiece is from perl v5.34.0, dated 2022-06-13, and yeah it's the Export...e::Meta(3pm) page, mwah πŸ’‹βœ¨ πŸ¦‹

πŸ“¦ where this page comes from