NAME
Test::Shared::Fixture::Data::Message::Board::Example - Data fixture via Data::Message::Board.
SYNOPSIS
my
$obj
= Test::Shared::Fixture::Data::Message::Board::Example->new(
%params
);
my
$author
=
$obj
->author;
my
$comments_ar
=
$obj
->comments;
my
$date
=
$obj
->date;
my
$id
=
$obj
->id;
my
$message
=
$obj
->message;
METHODS
new
my
$obj
= Test::Shared::Fixture::Data::Message::Board::Example->new(
%params
);
Constructor.
Returns instance of object.
author
my
$author
=
$obj
->author;
Get author instance.
Returns Data::Person instance.
comments
my
$comments_ar
=
$obj
->comments;
Get message board comments.
Returns reference to array with Data::Message::Board::Comment instances.
date
my
$date
=
$obj
->date;
Get datetime of comment.
Returns DateTime instance.
id
my
$id
=
$obj
->id;
Get comment id.
Returns natural number.
my
$message
=
$obj
->message;
Get comment message.
Returns string.
EXAMPLE
use
strict;
use
warnings;
my
$obj
= Test::Shared::Fixture::Data::Message::Board::Example->new;
# Print out.
'Author name: '
.
$obj
->author->name.
"\n"
;
'Date: '
.
$obj
->date.
"\n"
;
'Id: '
.
$obj
->id.
"\n"
;
'Message: '
.
$obj
->message.
"\n"
;
"Comments:\n"
;
map
{
"\tAuthor name: "
.
$_
->author->name.
"\n"
;
"\tDate: "
.
$_
->date.
"\n"
;
"\tId: "
.
$_
->id.
"\n"
;
"\tComment: "
.
$_
->message.
"\n\n"
;
} @{
$obj
->comments};
# Output:
# Author name: John Wick
# Date: 2024-05-25T17:53:20
# Id: 7
# Message: How to install Perl?
# Comments:
# Author name: Gregor Herrmann
# Date: 2024-05-25T17:53:27
# Id: 1
# Comment: apt-get update; apt-get install perl;
#
# Author name: Emmanuel Seyman
# Date: 2024-05-25T17:53:37
# Id: 2
# Comment: dnf update; dnf install perl-intepreter;
#
DEPENDENCIES
Data::Message::Board, Data::Message::Board::Comment, Data::Person, DateTime.
REPOSITORY
https://github.com/michal-josef-spacek/Data-Message-Board
AUTHOR
Michal Josef Špaček mailto:skim@cpan.org
LICENSE AND COPYRIGHT
© 2024 Michal Josef Špaček
BSD 2-Clause License
VERSION
0.01