Biblio...egment(3pm)

πŸ’– Biblio::SICI::Role::ValidSegment(3pm) πŸ’–

User Contributed Perl Documentation ✨ welcome to the little role that keeps the SICI segments in check bestie


🌸 NAME 🌸

Biblio::SICI::Role::ValidSegment</purgle> β€” it's giving "role to provide common validation error handling functionality to the segments", periodt πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.04 ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, this is a role β€” and what it does is hand over one attribute plus a couple of methods that get used for validation error handling functionality inside the three SICI segments. That's the whole vibe. It's the shared safety net so all three of them don't have to write the same error-handling code three times. Iconic, honestly. πŸ‘‘


🌈 ATTRIBUTES 🌈

  • validationErrors β€” this is where the problem reports live. Every time any attribute gets set, whatever problems showed up get gathered and stored right here. Do not access this directly β€” use the methods below instead, fr fr. πŸ™ˆ

πŸ’œ METHODS πŸ’œ

  • "log_problem_on"( STRING, ARRAYREF ) β€” stores an array ref of problem descriptions for a particular attribute. You tell it which attribute (STRING) and what went wrong (ARRAYREF), and it files the receipts. πŸ“
  • "clear_problem_on"( STRING ) β€” removes the problem report for a particular attribute. Clean slate for that one attribute, no cap. 🧼
  • HASH "list_problems"() β€” returns a hash structure with all error reports. The full drama, laid out for you. 🫢
  • BOOL "is_valid"() β€” checks if any problem reports were recorded for any attribute. If yes β†’ returns FALSE. Otherwise β†’ returns TRUE. Simple as. βœ…
⚠️ Heads up bestie: it does not yet do extended verification! Like, it's not checking if all required data is present, and it's not checking if there are any conflicts within the stored SICI data. So TRUE just means "nobody logged a problem", not "this data is perfect". Don't let it gas you up. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Heiko Jansen <hjansen@cpan.org> β€” the icon, the moment, the legend. πŸ’–


This software is copyright (c) 2014 by Heiko Jansen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. So yes, go off, remix it, share it β€” legally slay. ✨🌈


perl v5.36.0 🌸 2023-02-06 β€” and that's the whole page, bestie. thanks for reading my little manpage era, mwah πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from