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.01039';
4             # ABSTRACT: Github v3 Markdown API
5              
6 15     15   89 use Moo;
  15         27  
  15         91  
7 15     15   3738 use Carp qw( croak );
  15         41  
  15         2585  
8             extends 'Pithub::Base';
9              
10             has [qw( mode context )] => ( is => 'rw' );
11              
12              
13             sub render {
14 2     2 1 11445 my ( $self, %args ) = @_;
15 2 50       14 croak 'Missing key in parameters: data (hashref)' unless defined $args{data};
16              
17 2         7 for (qw( context mode )) {
18 4 100 66     38 $args{data}{$_} = $self->$_ if !exists $args{data}{$_} and $self->$_;
19             }
20              
21 2         36 return $self->request(
22             method => 'POST',
23             path => '/markdown',
24             %args,
25             );
26             }
27              
28             1;
29              
30             __END__