logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Perinci::Object::EnvResultTable - Represent enveloped result (table)

Author

       perlancar <perlancar@cpan.org>

Bugs

       Please report any bugs or feature requests on the bugtracker website
       <https://github.com/perlancar/perl-Perinci-Object/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.

Description

       This class is a subclass of Perinci::Object::EnvResult and provides convenience methods when you want to
       return table data.

Homepage

       Please visit the project's homepage at <https://metacpan.org/release/Perinci-Object>.

Methods

new($res)=>OBJECT
       Create a new object from $res enveloped result array.

   $envres->add_field($name,%attrs)
       Add a table field. This will create/push an entry to the "table.fields" result metadata array.

Name

       Perinci::Object::EnvResultTable - Represent enveloped result (table)

See Also

       Perinci::Object

       Perinci::Object::EnvResult

Source

       Source repository is at <https://github.com/perlancar/perl-Perinci-Object>.

Synopsis

        use Perinci::Object::EnvResultTable;

        sub myfunc {
            ...

            my $envres = Perinci::Object::EnvResultTable->new;

            # add fields
            $envres->add_field('foo');
            $envres->add_field('foo');

            # finally, return the result
            return $envres->as_struct;
        }

Version

       This document describes version 0.311 of Perinci::Object::EnvResultTable (from Perl distribution Perinci-
       Object), released on 2020-01-02.

See Also