File Coverage

blib/lib/Slack/BlockKit/Block/Markdown.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Slack::BlockKit::Block::Markdown 0.005;
2             # ABSTRACT: a Block Kit Markdown block
3              
4 4     4   27 use Moose;
  4         7  
  4         35  
5 4     4   28416 use MooseX::StrictConstructor;
  4         7  
  4         39  
6              
7             with 'Slack::BlockKit::Role::Block';
8              
9             #pod =head1 OVERVIEW
10             #pod
11             #pod This object represents a "markdown" block. These blocks only have one special
12             #pod attribute: the text they display.
13             #pod
14             #pod =cut
15              
16 4     4   13382 use v5.36.0;
  4         16  
17              
18 4     4   22 use Moose::Util::TypeConstraints qw(class_type);
  4         10  
  4         40  
19              
20             #pod =attr text
21             #pod
22             #pod The C<text> attribute must be a I<string>. This is in contrast to most other
23             #pod Block Kit blocks, where the C<text> attribute is a text composition object.
24             #pod The Markdown block acts sort of like a text composition object, but it can't be
25             #pod used as one. It can only be used as a block in a section.
26             #pod
27             #pod =cut
28              
29             has text => (
30             is => 'ro',
31             isa => 'Str',
32             required => 1,
33             );
34              
35             sub as_struct ($self) {
36             return {
37             type => 'markdown',
38             text => $self->text,
39             };
40             }
41              
42 4     4   2274 no Moose;
  4         12  
  4         23  
43             __PACKAGE__->meta->make_immutable;
44              
45             __END__
46              
47             =pod
48              
49             =encoding UTF-8
50              
51             =head1 NAME
52              
53             Slack::BlockKit::Block::Markdown - a Block Kit Markdown block
54              
55             =head1 VERSION
56              
57             version 0.005
58              
59             =head1 OVERVIEW
60              
61             This object represents a "markdown" block. These blocks only have one special
62             attribute: the text they display.
63              
64             =head1 PERL VERSION
65              
66             This module should work on any version of perl still receiving updates from
67             the Perl 5 Porters. This means it should work on any version of perl
68             released in the last two to three years. (That is, if the most recently
69             released version is v5.40, then this module should work on both v5.40 and
70             v5.38.)
71              
72             Although it may work on older versions of perl, no guarantee is made that the
73             minimum required version will not be increased. The version may be increased
74             for any reason, and there is no promise that patches will be accepted to
75             lower the minimum required perl.
76              
77             =head1 ATTRIBUTES
78              
79             =head2 text
80              
81             The C<text> attribute must be a I<string>. This is in contrast to most other
82             Block Kit blocks, where the C<text> attribute is a text composition object.
83             The Markdown block acts sort of like a text composition object, but it can't be
84             used as one. It can only be used as a block in a section.
85              
86             =head1 AUTHOR
87              
88             Ricardo SIGNES <cpan@semiotic.systems>
89              
90             =head1 COPYRIGHT AND LICENSE
91              
92             This software is copyright (c) 2024 by Ricardo SIGNES.
93              
94             This is free software; you can redistribute it and/or modify it under
95             the same terms as the Perl 5 programming language system itself.
96              
97             =cut