NAME

Test::Shared::Fixture::Data::Message::Board::Example - Data fixture via Data::Message::Board.

SYNOPSIS

use Test::Shared::Fixture::Data::Message::Board::Example;

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;

use Test::Shared::Fixture::Data::Message::Board::Example;

my $obj = Test::Shared::Fixture::Data::Message::Board::Example->new;

# Print out.
print 'Author name: '.$obj->author->name."\n";
print 'Date: '.$obj->date."\n";
print 'Id: '.$obj->id."\n";
print 'Message: '.$obj->message."\n";
print "Comments:\n";
map {
        print "\tAuthor name: ".$_->author->name."\n";
        print "\tDate: ".$_->date."\n";
        print "\tId: ".$_->id."\n";
        print "\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

http://skim.cz

LICENSE AND COPYRIGHT

© 2024 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.01