File Coverage

blib/lib/Slack/BlockKit/Block/RichText/Emoji.pm
Criterion Covered Total %
statement 11 15 73.3
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 15 21 71.4


line stmt bran cond sub pod time code
1             package Slack::BlockKit::Block::RichText::Emoji 0.005;
2             # ABSTRACT: a Block Kit rich text element for a :colon_code: emoji
3              
4 4     4   31 use Moose;
  4         6  
  4         54  
5 4     4   20176 use MooseX::StrictConstructor;
  4         9  
  4         39  
6              
7             #pod =head1 OVERVIEW
8             #pod
9             #pod This represents an C<emoji> element in Block Kit, which are generally put in
10             #pod place of or between L<text|Slack::BlockKit::Block::RichText::Text> elements in
11             #pod rich text sections.
12             #pod
13             #pod =cut
14              
15 4     4   14107 use v5.36.0;
  4         16  
16              
17             #pod =attr name
18             #pod
19             #pod This is the only notable attribute of an Emoji element. It's the name of the
20             #pod emoji, as you'd type it in Slack, except without the outer colons. So C<adult>
21             #pod rather than C<:adult:> and C<adult::skin-tone-4> rather than
22             #pod C<:adult::skin-tone-4:>.
23             #pod
24             #pod At time of writing, unknown emoji names are not an error, but will be displayed
25             #pod as text inside colons.
26             #pod
27             #pod =cut
28              
29             has name => (
30             is => 'ro',
31             isa => 'Str', # Unknown names show up as ":bogus_name_here:"
32             required => 1,
33             );
34              
35 0     0 0   sub as_struct ($self) {
  0            
  0            
36             return {
37 0           type => 'emoji',
38             name => $self->name,
39             };
40             }
41              
42 4     4   26 no Moose;
  4         9  
  4         29  
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::RichText::Emoji - a Block Kit rich text element for a :colon_code: emoji
54              
55             =head1 VERSION
56              
57             version 0.005
58              
59             =head1 OVERVIEW
60              
61             This represents an C<emoji> element in Block Kit, which are generally put in
62             place of or between L<text|Slack::BlockKit::Block::RichText::Text> elements in
63             rich text sections.
64              
65             =head1 PERL VERSION
66              
67             This module should work on any version of perl still receiving updates from
68             the Perl 5 Porters. This means it should work on any version of perl
69             released in the last two to three years. (That is, if the most recently
70             released version is v5.40, then this module should work on both v5.40 and
71             v5.38.)
72              
73             Although it may work on older versions of perl, no guarantee is made that the
74             minimum required version will not be increased. The version may be increased
75             for any reason, and there is no promise that patches will be accepted to
76             lower the minimum required perl.
77              
78             =head1 ATTRIBUTES
79              
80             =head2 name
81              
82             This is the only notable attribute of an Emoji element. It's the name of the
83             emoji, as you'd type it in Slack, except without the outer colons. So C<adult>
84             rather than C<:adult:> and C<adult::skin-tone-4> rather than
85             C<:adult::skin-tone-4:>.
86              
87             At time of writing, unknown emoji names are not an error, but will be displayed
88             as text inside colons.
89              
90             =head1 AUTHOR
91              
92             Ricardo SIGNES <cpan@semiotic.systems>
93              
94             =head1 COPYRIGHT AND LICENSE
95              
96             This software is copyright (c) 2024 by Ricardo SIGNES.
97              
98             This is free software; you can redistribute it and/or modify it under
99             the same terms as the Perl 5 programming language system itself.
100              
101             =cut