OAuth:...rmatter(3pm)

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

✨ 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::Formatters
  • OAuth::Lite2::Formatter::JSON
  • OAuth::Lite2::Formatter::XML
  • OAuth::Lite2::Formatter::FormURLEncoded

πŸ’œ AUTHOR πŸ’œ

Lyo Kato, <lyo.kato@gmail.com> β€” the legend, the main character, the one who wrote her 🫢


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