| 1 | # | ||
| 2 | # This file is part of POE-Component-Client-MPD | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2007 by Jerome Quelin. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | 24 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 24 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 24 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | package POE::Component::Client::MPD::Types; | ||
| 14 | # ABSTRACT: types used in the distribution | ||
| 15 | 24 | $POE::Component::Client::MPD::Types::VERSION = '2.000'; | |
| 16 | 24 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 24 | use Sub::Exporter -setup => { exports => [ qw{ | |
| 18 | Cooking Transform | ||
| 19 | 24 | ▶ | } ] }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 24 | enum Cooking => [ qw{ raw as_items as_kv strip_first } ]; | |
| 22 | 24 | enum Transform => [ qw{ as_scalar as_stats as_status } ]; | |
| 23 | |||
| 24 | 24 | 1; | |
| 25 | |||
| 26 | __END__ | ||
| 27 | |||
| 28 | =pod | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | POE::Component::Client::MPD::Types - types used in the distribution | ||
| 33 | |||
| 34 | =head1 VERSION | ||
| 35 | |||
| 36 | version 2.000 | ||
| 37 | |||
| 38 | =head1 DESCRIPTION | ||
| 39 | |||
| 40 | This module implements the specific types used by the distribution, and | ||
| 41 | exports them. It is using L<Sub::Exporter> underneath, so you can use | ||
| 42 | all the shenanigans to change the export names. | ||
| 43 | |||
| 44 | Current types defined and exported: | ||
| 45 | |||
| 46 | =over 4 | ||
| 47 | |||
| 48 | =item * C<Cooking> - a simple enum to know what to do about that data | ||
| 49 | |||
| 50 | =over 4 | ||
| 51 | |||
| 52 | =item * C<raw> - data should not be touched | ||
| 53 | |||
| 54 | =item * C<as_items> - data is to be transformed as L<Audio::MPD::Common::Item> | ||
| 55 | |||
| 56 | =item * C<as_kv> - data is to be cooked as key/values (hash) | ||
| 57 | |||
| 58 | =item * C<strip_first> - data should have its first field stripped | ||
| 59 | |||
| 60 | =back | ||
| 61 | |||
| 62 | =item * C<Transform> - a simple enum to know what to do about the data, | ||
| 63 | B<after> it has been cooked. Possible values are: | ||
| 64 | |||
| 65 | =over 4 | ||
| 66 | |||
| 67 | =item * C<as_scalar> - return the first element instead of the full list | ||
| 68 | |||
| 69 | =item * C<as_stats> - transform the data from key/value to | ||
| 70 | C<Audio::MPD::Common::Stats> | ||
| 71 | |||
| 72 | =item * C<as_status> - transform the data from key/value to | ||
| 73 | C<Audio::MPD::Common::Status> | ||
| 74 | |||
| 75 | =back | ||
| 76 | |||
| 77 | =back | ||
| 78 | |||
| 79 | =head1 AUTHOR | ||
| 80 | |||
| 81 | Jerome Quelin | ||
| 82 | |||
| 83 | =head1 COPYRIGHT AND LICENSE | ||
| 84 | |||
| 85 | This software is copyright (c) 2007 by Jerome Quelin. | ||
| 86 | |||
| 87 | This is free software; you can redistribute it and/or modify it under | ||
| 88 | the same terms as the Perl 5 programming language system itself. | ||
| 89 | |||
| 90 | =cut | ||