WebService::Toggl::Role::Item - Create roles for all WebService::Toggl::API Items
package WebService::Toggl::API::Tag; use WebService::Toggl::Role::Item as => 'JsonItem'; use Moo; with 'WebService::Toggl::API'; use namespace::clean; with JsonItem( bools => [ qw() ], strings => [ qw(name) ], integers => [ qw(id wid) ], ); sub api_path { 'tags' } sub api_id { shift->id }
This package constructs dynamic roles for WebService::Toggl::API objects representing individual Items. The calling class gives it a list of boolean fields, a list of string fields, and a list of integer fields. This package will then construct type-checked accessors for all the provided attributes to fetch them from the raw response. Calling the constructed attributes will cause an API request to be made, unless the raw data already exists in the object.
The raw data returned from an API request.
Returns the API URL for the object.
Copyright (C) Fitz Elliott.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Fitz Elliott <felliott@fiskur.org>
To install WebService::Toggl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Toggl
CPAN shell
perl -MCPAN -e shell install WebService::Toggl
For more information on module installation, please visit the detailed CPAN module installation guide.