summaryrefslogtreecommitdiff
path: root/lib/MooseX/Net/API/Role/Format.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-07-16 16:10:41 +0200
committerfranck cuny <franck@lumberjaph.net>2010-07-16 16:10:41 +0200
commite97449eaa8bd3a408763057f9ca2253d93e2a3d0 (patch)
tree4fd0dc6ed899efe361e314adfc913b9aa6b0a1a4 /lib/MooseX/Net/API/Role/Format.pm
parentcheck if auth_method is declared (diff)
downloadnet-http-api-e97449eaa8bd3a408763057f9ca2253d93e2a3d0.tar.gz
rename from mx::net::api to net::http::api
Diffstat (limited to 'lib/MooseX/Net/API/Role/Format.pm')
-rw-r--r--lib/MooseX/Net/API/Role/Format.pm65
1 files changed, 0 insertions, 65 deletions
diff --git a/lib/MooseX/Net/API/Role/Format.pm b/lib/MooseX/Net/API/Role/Format.pm
deleted file mode 100644
index 5c37a47..0000000
--- a/lib/MooseX/Net/API/Role/Format.pm
+++ /dev/null
@@ -1,65 +0,0 @@
-package MooseX::Net::API::Role::Format;
-
-# ABSTRACT: Set appropriate format to request header
-
-use Moose::Role;
-use Moose::Util::TypeConstraints;
-
-sub content_type {
- { json => {value => 'application/json', module => 'JSON',},
- yaml => {value => 'text/x-yaml', module => 'YAML'},
- xml => {value => 'text/xml', module => 'XML::Simple'},
- };
-}
-
-subtype Format => as 'Str' => where {
- my $format = shift;
- grep {/^$format$/} keys %{content_type()};
-};
-
-enum 'FormatMode' => qw(content-type append);
-
-has api_format => (
- is => 'rw',
- isa => 'Format',
- lazy => 1,
- default => sub {
- my $self = shift;
- $self->meta->get_api_option('api_format');
- }
-);
-
-has api_format_mode => (
- is => 'rw',
- isa => 'FormatMode',
- lazy => 1,
- default => sub {
- my $self = shift;
- my $mode = $self->meta->get_api_option('api_format_mode') || 'append';
- $mode;
- }
-);
-
-1;
-
-=head1 SYNOPSIS
-
-=head1 DESCRIPTION
-
-=head2 METHODS
-
-=over 4
-
-=item B<content_type>
-
-=back
-
-=head2 ATTRIBUTES
-
-=over 4
-
-=item B<api_format>
-
-=item B<api_format_mode>
-
-=back