File Coverage

blib/lib/Pithub/Markdown.pm
Criterion Covered Total %
statement 11 11 100.0
branch 3 4 75.0
condition 2 3 66.6
subroutine 3 3 100.0
pod 1 1 100.0
total 20 22 90.9


line stmt bran cond sub pod time code
1             package Pithub::Markdown;
2             our $AUTHORITY = 'cpan:PLU';
3             our $VERSION = '0.01040';
4             # ABSTRACT: Github v3 Markdown API
5              
6 16     16   103 use Moo;
  16         29  
  16         76  
7 16     16   4136 use Carp qw( croak );
  16         31  
  16         2877  
8             extends 'Pithub::Base';
9              
10             has [qw( mode context )] => ( is => 'rw' );
11              
12              
13             sub render {
14 2     2 1 10585 my ( $self, %args ) = @_;
15 2 50       11 croak 'Missing key in parameters: data (hashref)' unless defined $args{data};
16              
17 2         8 for (qw( context mode )) {
18 4 100 66     30 $args{data}{$_} = $self->$_ if !exists $args{data}{$_} and $self->$_;
19             }
20              
21 2         18 return $self->request(
22             method => 'POST',
23             path => '/markdown',
24             %args,
25             );
26             }
27              
28             1;
29              
30             __END__