package Test::Mock::Signature::Meta;

use strict;
use warnings;

use Test::Mock::Signature;
use Test::Mock::Signature::Dispatcher;

sub new {
    my ($class, %params) = @_;

    return bless(\%params, $class);

sub callback {
    my $self       = shift;
    my $callback   = shift;

    return $self->{'callback'} unless defined $callback;

    my $real_class = $self->{'class'};
    my $mock       = Test::Mock::Signature->new($real_class);

    $self->{'callback'}  = $callback;

    my $dispatcher = $mock->dispatcher($self->{'method'});

sub params {
    my $self = shift;

    return $self->{'params'};



=head1 NAME

Test::Mock::Signature::Meta - meta class. Used as a signature container.


Create meta container module:

    my $meta = Test::Mock::Signature::Meta->new(
        class  => 'My::Real::Class',
        method => 'do_something',
        params => [ 1, 2, 3 ]


Module for storing meta information of the signature. Used internally to
iterate between meta clases in L<Test::Mock::Signature::Dispatcher>.

=head1 METHODS

=head2 new()

Takes 3 paramters (as a key value pairs).

=over 8

=item class

Name of the real class which we are mocking.

=item method

Name of the mocked method.

=item params

Array reference of the parameters.


=head2 callback( [ $code_ref ] )

Set callback for the given meta information if C<$code_ref> is given or return
callback if not.

=head2 params()

Getter for the params.

=head1 AUTHOR

cono E<lt>cono@cpan.orgE<gt>


Copyright 2014 - cono

=head1 LICENSE

Artistic v2.0

=head1 SEE ALSO