App-BitBucketCli
view release on metacpan or search on metacpan
lib/App/BitBucketCli/Branch.pm view on Meta::CPAN
package App::BitBucketCli::Branch;
# Created on: 2015-11-12 07:36:10
# 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 /;
our $VERSION = 0.009;
extends qw/App::BitBucketCli::Base/;
has [qw/
displayId
isDefault
latestChangeset
latestCommit
metadata
project
repository
/] => (
is => 'rw',
);
has team => (
is => 'rw',
builder => '_team',
lazy => 1,
);
has pull_request => (
is => 'rw',
builder => '_pull_request',
lazy => 1,
);
has primary_job => (
is => 'rw',
builder => '_primary_job',
lazy => 1,
);
has pr_job => (
is => 'rw',
builder => '_pr_job',
lazy => 1,
);
has lastChangeTime => (
is => 'rw',
builder => '_lastChangeTime',
lazy => 1,
);
sub timestamp { $_[0]->metadata->{'com.atlassian.stash.stash-branch-utils:latest-changeset-metadata'}{authorTimestamp}/1000; }
sub name { $_[0]->displayId; }
sub _pull_request {
my ($self) = @_;
my $prs = $self->{metadata}{'com.atlassian.stash.stash-ref-metadata-plugin:outgoing-pull-request-metadata'};
return 0 if !$prs;
return 0 if exists $prs->{open};
return App::BitBucketCli::PullRequest->new($prs->{pullRequest});
}
sub _lastChangeTime {
my ($self) = @_;
my $metadata = $self->metadata;
( run in 0.687 second using v1.01-cache-2.11-cpan-39bf76dae61 )