App-BitBucketCli

 view release on metacpan or  search on metacpan

lib/App/BitBucketCli/Links.pm  view on Meta::CPAN

package App::BitBucketCli::Links;

# Created on: 2015-09-16 16:41:19
# Create by:  Ivan Wills
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$

use Moo;
use warnings;
use Carp;
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;
use App::BitBucketCli::Link;

our $VERSION = 0.009;

has [qw/
    clone
    self
/] => (
    is => 'rw',
);

around BUILDARGS => sub {
    my ( $orig, $class, @args ) = @_;

    my $args
        = !@args     ? {}
        : @args == 1 ? { %{ $args[0] } }
        :              {@args};
    my $arg = {};

    for my $type (keys %{ $args }) {
        $arg->{$type} = [];
        for my $link (@{ $args->{$type} }) {
            push @{ $arg->{$type} }, App::BitBucketCli::Link->new($link);
        }
    }

    return $class->$orig($arg);
};

sub TO_JSON {
    my ($self) = @_;
    return { %{ $self } };
}

1;

__END__

=head1 NAME

App::BitBucketCli::Links - Stores a projects details

=head1 VERSION

This documentation refers to App::BitBucketCli::Links version 0.009

=head1 SYNOPSIS

   use App::BitBucketCli::Links;

   # Brief but working code example(s) here showing the most common usage(s)
   # This section will be as far as many users bother reading, so make it as
   # educational and exemplary as possible.


=head1 DESCRIPTION

=head1 SUBROUTINES/METHODS



( run in 0.363 second using v1.01-cache-2.11-cpan-39bf76dae61 )