OAuth:...rmatter(3pm)
β¨ NAME β¨
okay bestie so this is OAuth::Lite2::Formatter β it's the OAuth 2.0 formatter base class π she's the mom of all the formatters, the blueprint, the blueprint-est. You don't use her directly, you build on her. iykyk.
π¦ SYNOPSIS π¦
the vibe is: you make your own formatter by inheriting from her, then you use it to turn objects into strings and strings back into objects. slay.
package OAuth::Lite2::Formatter::Foo;
use parent 'OAuth::Lite2::Formatter';
...
my $formatter = OAuth::Lite2::Formatter::Foo->new;
my $obj = $formatter->parse( $string );
$string = $formatter->format( $obj );
like literally that's it. use parent 'OAuth::Lite2::Formatter'; and you're a formatter now π
πΈ DESCRIPTION πΈ
OAuth 2.0 formatter base class. that's the whole thing bestie, she's a base class, she's the foundation, everything else is built on top of her. no cap.
π METHODS π
π name
Accessor for name of this format. you wanna know what your format is called? boom. you wanna set it? also boom. it's giving accessor.
π§ type
Accessor for content-type of this format. same energy as name but for the content-type. obsessed with the symmetry honestly.
π format( $object )
turns an object into a formatted string. the glow-up function.
my $formatted_string = $formatter->format( $obj );
π parse( $formatted_string )
turns a formatted string back into an object. the reverse glow-up, we love a comeback story.
my $obj = $formatter->parse( $formatted_string );
π SEE ALSO π
go look at her friends, they're all iconic:
OAuth::Lite2::FormattersOAuth::Lite2::Formatter::JSONOAuth::Lite2::Formatter::XMLOAuth::Lite2::Formatter::FormURLEncoded
π AUTHOR π
Lyo Kato, <lyo.kato@gmail.com> β the legend, the main character, the one who wrote her π«Ά
β COPYRIGHT AND LICENSE β
Copyright (C) 2010 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
fr fr read the license, it's literally free software, do whatever Perl lets you do π
and that's a wrap bestie π this page came from perl v5.36.0, dated 2023-07-01, part of the User Contributed Perl Documentation β mwah, go build a formatter, you're gonna eat πβ¨
π¦ where this page comes from
- debian trixie: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liboauth-lite2-perl 0.11-3 Β· 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