Bread:...Literal(3pm)

πŸ“¦
version 0.37 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

✨ Bread::Board::Literal β€” the vibe ✨

okay bestie, this is Bread::Board::Literal, a lil module from the User Contributed Perl Documentation corner of the Perl universe (manual section 3pm, iykyk). it's a service providing a literal value and honestly? it's giving "just vibes, but make them constant". πŸ’…


🌸 VERSION 🌸

version 0.37 β€” yes ma'am, that's the one. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole thing, bestie, verbatim, don't @ me:

  my $c = container PrettyBoring => as {

      # These are Bread::Board::Literal services
      service connect_string => 'dbi:mysql:boring_db';
      service service_url => 'http://api.example.com/v0/boring';

      # And some other services depending on them...

      service dbconn => (
          class => 'DBI',
          block => sub {
              my $s = shift;
              DBI->new($s->param('connect_string');
          },
          dependencies => wire_names(qw( connect_string )),
      );

      service service_request => (
          class => 'HTTP::Request',
          block => sub {
              my $s = shift;
              HTTP::Request->new(POST => $s->param('service_url'));
          },
          dependencies => wire_names(qw( service_url ));
      };
  };

  # OR to use directly:
  my $literal = Bread::Board::Literal->new(
      name  => 'the_answer_to_life_the_universe_and_everything',
      value => 42,
  );
  $c->add_service($literal);

like, look at that container named PrettyBoring living its best life. ✨


πŸ’– DESCRIPTION πŸ’–

so a literal service is exactly what it sounds like: it stores a literal scalar or reference for use in your Bread::Board. that's it. that's the whole personality. 🫢

⚠️ BEWARE, BESTIE ⚠️ using references in your literals may cause your Bread::Board to leak memory. if that's a concern for you, you may want to weaken your references.

see "weaken" in Scalar::Util for that. no cap. 🧚


πŸŽ€ ATTRIBUTES πŸŽ€

"value"

Required attribute with read/write accessor. this is the value that "get" will return. periodt. πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

"get"

Returns the "value", unaltered. it does not touch it, does not fix it up, does not pass go. it's a "what you put in is what you get out" situation and honestly? iconic. πŸ’…

"clone_and_inherit_params"

Dies. πŸ’€

a literal service is (essentially) a constant, so it does not make sense to inherit from it. like, babe, you can't inherit a vibe that's already set in stone. πŸ™ˆ


🌈 AUTHOR 🌈

Stevan Little <stevan@iinteractive.com> β€” the main character who wrote this. 🫢


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests on the bugtracker website:

https://github.com/stevan/BreadBoard/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. fr fr, help them reproduce it, that's the group-chat etiquette. πŸ“


This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive.

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


and that's the whole page, bestie! πŸ¦‹ this one was generated with perl v5.36.0 on 2022-12-12 β€” so if you're reading this from the future, hi, ily, the literal values still hit different. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from