Valida...::City(3pm)

πŸ“¦
version 7.900059 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Valida...::City(3pm) πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation section, and it's giving very specific energy. sit down, grab a πŸ“, let's get into it.


✨ NAME ✨

Validation::Class::Directive::City β€” the City Directive for Validation Class Field Definitions. yes, that's the whole name, it's a mouthful, we love her anyway. πŸ‘‘


🌸 VERSION 🌸

version 7.900059

(she's got numbers, and she's proud of them πŸ’…)


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's literally how you use it, copy-paste core:

use Validation::Class::Simple;

my $rules = Validation::Class::Simple->new(
    fields => {
        address_city  => {
            city => 1
        }
    }
);

# set parameters to be validated
$rules->params->add($parameters);

# validate
unless ($rules->validate) {
    # handle the failures
}

so you set up your $rules with a fields hash, you give address_city a city => 1 and boom, the vibe check is armed. ✨ then you shove your $parameters into $rules->params->add($parameters) β€” that's the "here's the stuff, pls judge it" step. and then $rules->validate does the actual work. if it comes back false, you're in the unless block handling the failures, which is the "cry a little and deal with it" step 😭🫢


πŸŽ€ DESCRIPTION πŸŽ€

so Validation::Class::Directive::Between is a core validation class field directive (yes, the doc says Between right there in a page about City β€” we don't question the ancestors, we just respect them πŸ™ˆ) and what she does is give you the ability to perform city/area validations for cities in the USA. πŸ‡ΊπŸ‡Έ

and the best part? Cities will be validated without regard for case. so portland, Portland, PORTLAND β€” all the same to her. case-insensitive queen behavior, no cap. πŸ’…βœ¨


🌈 AUTHOR 🌈

Al Newkirk <anewkirk@ana.io>

(shoutout to Al, iconic, main character energy fr fr πŸ‘‘)


This software is copyright (c) 2011 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


⭐ heads up bestie: those license lines are the legal tea, so keep them exactly as they are β€” free software, same terms as Perl 5 itself, periodt.

and that's the whole page!! this was Valida...::City(3pm) from perl v5.36.0, dated 2023-06-11 β€” mwah, go validate some cities, you absolute legend πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from