Data::...::Mock(3pm)

πŸ“¦
version 0.021 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Data::TableReader::Decoder::Mock πŸ’–

okay bestie, so this is Data::TableReader::Decoder::Mock β€” it's a Decoder that returns supplied data without decoding anything. yeah. that's the whole vibe. it doesn't decode, it just serves. no cap. ✨


🌸 VERSION 🌸

version 0.021 β€” that's the one, bestie. πŸ’…


✨ SYNOPSIS ✨

so you can do it like this, with a whole list of datasets:

decoder => {
  CLASS => 'Mock',
  datasets => [
    [ # Data Set 0
       [ 1, 2, 3, 4, 5 ],
       ...
    ],
    [ # Data Set 1
       [ 1, 2, 3, 4, 5 ],
       ...
    ],
  ]
}

or, if you're feeling lowkey minimal today, like this:

decoder => {
  CLASS => 'Mock',
  table => [
     [ 1, 2, 3, 4, 5 ],
     ...
  ],
}

This doesn't actually decode anything, bestie β€” it just returns verbatim rows of data from the arrayrefs that you supply. it's giving "I'm just the messenger". 🫢

You can provide one or multiple tables, your call, no pressure. and the 'table' constructor parameter? it's literally just an alias for datasets[0]. same thing, different font. πŸ’…


πŸŽ€ ATTRIBUTES πŸŽ€

See the attributes from the parent class: Data::TableReader::Decoder. go look, it's family. πŸ‘‘

πŸ¦‹ datasets

The verbatim data which will be returned by the iterator. this can be an array of tables, or one table itself β€” either is fine, she contains multitudes. πŸ’–

real talk though: a table must be composed of arrayrefs, and the cells of the table cannot themselves be arrayrefs. like, that's the rule. no nesting-inception, bestie, we're not doing that today. πŸ’€

🌈 AUTHOR 🌈

Michael Conrad <mike@nrdvana.net> β€” iconic behavior, honestly. πŸ‘‘


This software is copyright (c) 2024 by Michael Conrad.

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. periodt. πŸŽ€


perl v5.38.2 Β· 2024-06-21 β€” that's the tea, bestie, documented and dated. go forth and mock responsibly πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from