=pod

=encoding utf8

=head1 NAME

WebService::Fake - Fake a Web Service

=head1 VERSION

This document describes WebService::Fake version 0.002.

=head1 SYNOPSIS

   use WebService::Fake;


=head1 DESCRIPTION


This module is at the heart of the webservice script C<waf>, although you
can find the real documentation there.


=head1 METHODS

=head2 B<< body_expander >>

   my $sub_ref = $obj->body_expander($spec, $config);

Generate a sub reference that can be called to generate a body response.
The actual body generated is then subject to pass through the sub
reference generated by L</body_wrapper>.

=head2 B<< body_wrapper >>

   my $sub_ref = $obj->body_wrapper($spec, $config);

Generate a wrapper to be applied when generating the body for a response.
This allows you to factor all your response boilerplate for the body into
one single place.

=head2 B<< callback >>

   my $sub_ref = $obj->callback($spec, $config);

Generate a callback function to be installed as a route.

=head2 B<< headers_expander >>

   my $sub_ref = $obj->headers_expander($spec, $config);

Generate a wrapper to eventually generate headers for a response.

=head2 B<< load_config >>

   my $config = $obj->load_config;

Load the configuration file, which is whatever is pointed by environment
variable C<WEBSERVICE_FAKE> or by default file C<webservice-fake.yml> in
the current directory. Returns the loaded configuration.

=head2 B<< startup >>

   $obj->startup;

Initialization method called by L<Mojolicious>.

=head1 BUGS AND LIMITATIONS

Report bugs through GitHub (patches welcome).

=head1 SEE ALSO

Foo::Bar.

=head1 AUTHOR

Flavio Poletti <polettix@cpan.org>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2016 by Flavio Poletti <polettix@cpan.org>

This module is free software. You can redistribute it and/or modify it
under the terms of the Artistic License 2.0.

This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.

=cut
