The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

JSONAPI::Document::Role::Attributes - Consumable role to build resource attributes

VERSION

version 2.4

DESCRIPTION

This role allows you to customize the fetching of a rows attributes.

Simply add this to the row object and implement the attributes method and it'll be called instead of JSONAPI::Document doing the building of attributes.

The method is passed a single argument, an ArrayRef of requested fields, which should be honoured in the returned HashRef.

attributes(ArrayRef $fields?) : HashRef

Returns a hashref of columns/attributes for the consuming classes row.