File Coverage

blib/lib/Net/StackExchange2/V2/Posts.pm
Criterion Covered Total %
statement 15 25 60.0
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 20 32 62.5


line stmt bran cond sub pod time code
1             package Net::StackExchange2::V2::Posts;
2              
3 1     1   20 use 5.006;
  1         3  
  1         730  
4 1     1   9 use strict;
  1         2  
  1         38  
5 1     1   5 use warnings FATAL => 'all';
  1         3  
  1         59  
6 1     1   6 use Sub::Name qw(subname);
  1         2  
  1         104  
7 1     1   6 use Net::StackExchange2::V2::Common qw(query no_params one_param);
  1         2  
  1         668  
8              
9             our $VERSION = "0.05";
10              
11             sub new {
12 0     0 0   my ($class, $params) = @_;
13 0           my $self = $params;
14 0           bless $self, $class;
15              
16 0           *posts_all = subname(
17             "Net::StackExchange2::V2::Posts::posts_all",
18             no_params("posts"),
19             );
20 0           *posts = subname(
21             "Net::StackExchange2::V2::Posts::posts",
22             one_param("posts"),
23             );
24 0           *posts_comments = subname(
25             "Net::StackExchange2::V2::Posts::posts_comments",
26             one_param("posts", "comments"),
27             );
28 0           *posts_comments_add = subname(
29             "Net::StackExchange2::V2::Posts::posts_comments_add",
30             one_param("posts", "comments/add", {post => 1}),
31             );
32            
33 0           *posts_revisions = subname(
34             "Net::StackExchange2::V2::Posts::posts_revisions",
35             one_param("posts", "revisions"),
36             );
37 0           *posts_suggested_edits = subname(
38             "Net::StackExchange2::V2::Posts::posts_suggested_edits",
39             one_param("posts", "suggested-edits"),
40             );
41 0           return $self;
42             }
43             1; #END of Net::StackExchange2::V2::Posts
44             __END__