File Coverage

blib/lib/Slack/BlockKit/Block/RichText/Text.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Slack::BlockKit::Block::RichText::Text 0.005;
2             # ABSTRACT: a Block Kit rich text object for the text in the rich text
3              
4 4     4   29 use Moose;
  4         9  
  4         39  
5 4     4   22778 use MooseX::StrictConstructor;
  4         8  
  4         45  
6              
7             with 'Slack::BlockKit::Role::HasBasicStyle';
8              
9             #pod =head1 OVERVIEW
10             #pod
11             #pod When building a hunk of rich text with Slack::BlockKit, it's this object that
12             #pod contains most of the actual text. These objects represent the objects in
13             #pod Block Kit with a C<type> of "text".
14             #pod
15             #pod This class includes L<Slack::BlockKit::Role::HasBasicStyle>, so these objects
16             #pod can have C<bold>, C<code>, C<italic>, and C<strike> styles.
17             #pod
18             #pod (For more information on how to actually build text look at
19             #pod L<Slack::BlockKit::Sugar>.)
20             #pod
21             #pod =cut
22              
23 4     4   15778 use v5.36.0;
  4         18  
24              
25             #pod =attr text
26             #pod
27             #pod This is the actual text of the text object. It's a string, and required.
28             #pod
29             #pod =cut
30              
31             has text => (
32             is => 'ro',
33             isa => 'Str',
34             required => 1,
35             );
36              
37             sub as_struct ($self) {
38             return {
39             type => 'text',
40             text => q{} . $self->text,
41             };
42             }
43              
44 4     4   32 no Moose;
  4         8  
  4         31  
45             __PACKAGE__->meta->make_immutable;
46              
47             __END__
48              
49             =pod
50              
51             =encoding UTF-8
52              
53             =head1 NAME
54              
55             Slack::BlockKit::Block::RichText::Text - a Block Kit rich text object for the text in the rich text
56              
57             =head1 VERSION
58              
59             version 0.005
60              
61             =head1 OVERVIEW
62              
63             When building a hunk of rich text with Slack::BlockKit, it's this object that
64             contains most of the actual text. These objects represent the objects in
65             Block Kit with a C<type> of "text".
66              
67             This class includes L<Slack::BlockKit::Role::HasBasicStyle>, so these objects
68             can have C<bold>, C<code>, C<italic>, and C<strike> styles.
69              
70             (For more information on how to actually build text look at
71             L<Slack::BlockKit::Sugar>.)
72              
73             =head1 PERL VERSION
74              
75             This module should work on any version of perl still receiving updates from
76             the Perl 5 Porters. This means it should work on any version of perl
77             released in the last two to three years. (That is, if the most recently
78             released version is v5.40, then this module should work on both v5.40 and
79             v5.38.)
80              
81             Although it may work on older versions of perl, no guarantee is made that the
82             minimum required version will not be increased. The version may be increased
83             for any reason, and there is no promise that patches will be accepted to
84             lower the minimum required perl.
85              
86             =head1 ATTRIBUTES
87              
88             =head2 text
89              
90             This is the actual text of the text object. It's a string, and required.
91              
92             =head1 AUTHOR
93              
94             Ricardo SIGNES <cpan@semiotic.systems>
95              
96             =head1 COPYRIGHT AND LICENSE
97              
98             This software is copyright (c) 2024 by Ricardo SIGNES.
99              
100             This is free software; you can redistribute it and/or modify it under
101             the same terms as the Perl 5 programming language system itself.
102              
103             =cut