Date-Lectionary-Daily
view release on metacpan or search on metacpan
Revision history for Date::Lectionary::Daily
1.20180316 2018-03-16
- Added support for the new ACNA daily lectionary based on the secular calendar
- Migrated the former ACNA daily lectionary to be the non-default lectionary, but kept it around because I like it
1.20180410 2018-04-10
- Added author tests to ensure better distribution quality
- Tidied up the code a little bit
1.20180410 2018-04-17
- Corrected the pax headers issue in the distribution package
DESCRIPTION
Date::Lectionary::Daily takes a Time::Piece date and returns readings
for morning and evening prayer for that date.
CONSTRUCTOR ATTRIBUTES
date
The Time::Piece object date of the day you woudl like the lessons for.
lectionary
One of two choices `acna-sec` for the new secular calendar based ACNA
daily lectionary or `acna-xian` for the previous liturgically-based ACNA
daily lectionary.
If lectionary is not given at construction, the ACNA secular daily
lectionary â `acna-sec` â will be used.
ATTRIBUTES
week
The name of the liturgical week in the lectionary; e.g. `The First
Sunday in Lent`.
day
The name of the day of the week; e.g. `Sunday`.
tradition
Presently only returns `acna`. Future version of the module may include
daily lectionary from other traditions.
type
Returns `secular` for daily lectionaries based on the secular/civil
calendar and `liturgical` for daily lectionaries based on the liturgical
calendar.
readings
A hasref of the readings for the day.
SUBROUTINES/METHODS
BUILD
Constructor for the Date::Lectionary object. Takes a Time::Piect object,
"date", to create the object.
_buildType
Private method to determine if the daily lectionary follows the secular
calendar or the liturgical calendar.
_buildTradition
Private method to determine the Sunday lectionary tradition of the daily
lectionary selected. Used to determine the liturgical week the day falls
within.
_parseLectDB
Private method to open and parse the lectionary XML to be used by other
methods to XPATH queries.
_checkFixed
Private method to determine if the day given is a fixed holiday rather
than a standard day.
_buildReadingsLiturgical
Private method that returns an ArrayRef of strings for the lectionary
readings associated with the date according to the liturgical calendar.
_buildReadingsSecular
Private method that returns an ArrayRef of strings for the lectionary
readings associated with the date according to the secular calendar.
AUTHOR
Michael Wayne Arnold, "<michael at rnold.info>"
BUGS
Please report any bugs or feature requests to "bug-date-lectionary-daily
at rt.cpan.org", or through the web interface at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Date-Lectionary-Daily>.
I will be notified, and then you'll automatically be notified of
progress on your bug as I make changes.
Date::Lectionary::Daily takes a Time::Piece date and returns readings for morning and evening prayer for that date.
## CONSTRUCTOR ATTRIBUTES
### date
The Time::Piece object date of the day you woudl like the lessons for.
### lectionary
One of two choices \`acna-sec\` for the new secular calendar based ACNA daily lectionary or \`acna-xian\` for the previous liturgically-based ACNA daily lectionary.
If lectionary is not given at construction, the ACNA secular daily lectionary â \`acna-sec\` â will be used.
## ATTRIBUTES
### week
The name of the liturgical week in the lectionary; e.g. \`The First Sunday in Lent\`.
### day
The name of the day of the week; e.g. \`Sunday\`.
### tradition
Presently only returns \`acna\`. Future version of the module may include daily lectionary from other traditions.
### type
Returns \`secular\` for daily lectionaries based on the secular/civil calendar and \`liturgical\` for daily lectionaries based on the liturgical calendar.
### readings
A hasref of the readings for the day.
# SUBROUTINES/METHODS
## BUILD
Constructor for the Date::Lectionary object. Takes a Time::Piect object, `date`, to create the object.
## \_buildType
Private method to determine if the daily lectionary follows the secular calendar or the liturgical calendar.
## \_buildTradition
Private method to determine the Sunday lectionary tradition of the daily lectionary selected. Used to determine the liturgical week the day falls within.
## \_parseLectDB
Private method to open and parse the lectionary XML to be used by other methods to XPATH queries.
## \_checkFixed
Private method to determine if the day given is a fixed holiday rather than a standard day.
## \_buildReadingsLiturgical
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the liturgical calendar.
## \_buildReadingsSecular
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the secular calendar.
# AUTHOR
Michael Wayne Arnold, `<michael at rnold.info>`
# BUGS
<div>
<a href="https://travis-ci.org/marmanold/Date-Lectionary-Daily"><img src="https://travis-ci.org/marmanold/Date-Lectionary-Daily.svg?branch=master"></a>
</div>
Date::Lectionary::Daily takes a Time::Piece date and returns readings for morning and evening prayer for that date.
=head2 CONSTRUCTOR ATTRIBUTES
=head3 date
The Time::Piece object date of the day you woudl like the lessons for.
=head3 lectionary
One of two choices `acna-sec` for the new secular calendar based ACNA daily lectionary or `acna-xian` for the previous liturgically-based ACNA daily lectionary.
If lectionary is not given at construction, the ACNA secular daily lectionary â `acna-sec` â will be used.
=head2 ATTRIBUTES
=head3 week
The name of the liturgical week in the lectionary; e.g. `The First Sunday in Lent`.
=head3 day
The name of the day of the week; e.g. `Sunday`.
=head3 tradition
Presently only returns `acna`. Future version of the module may include daily lectionary from other traditions.
=head3 type
Returns `secular` for daily lectionaries based on the secular/civil calendar and `liturgical` for daily lectionaries based on the liturgical calendar.
=head3 readings
A hasref of the readings for the day.
=cut
=head1 SUBROUTINES/METHODS
=head2 BUILD
Constructor for the Date::Lectionary object. Takes a Time::Piect object, C<date>, to create the object.
=cut
=head2 _buildType
Private method to determine if the daily lectionary follows the secular calendar or the liturgical calendar.
=cut
=head2 _buildTradition
Private method to determine the Sunday lectionary tradition of the daily lectionary selected. Used to determine the liturgical week the day falls within.
=cut
=head2 _checkFixed
Private method to determine if the day given is a fixed holiday rather than a standard day.
=cut
=head2 _buildReadingsLiturgical
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the liturgical calendar.
=cut
=head2 _buildReadingsSecular
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the secular calendar.
=cut
=head1 AUTHOR
Michael Wayne Arnold, C<< <michael at rnold.info> >>
=head1 BUGS
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
Date::Lectionary::Daily takes a Time::Piece date and returns readings for morning and evening prayer for that date.
=head2 CONSTRUCTOR ATTRIBUTES
=head3 date
The Time::Piece object date of the day you woudl like the lessons for.
=head3 lectionary
One of two choices `acna-sec` for the new secular calendar based ACNA daily lectionary or `acna-xian` for the previous liturgically-based ACNA daily lectionary.
If lectionary is not given at construction, the ACNA secular daily lectionary â `acna-sec` â will be used.
=head2 ATTRIBUTES
=head3 week
The name of the liturgical week in the lectionary; e.g. `The First Sunday in Lent`.
=head3 day
The name of the day of the week; e.g. `Sunday`.
=head3 tradition
Presently only returns `acna`. Future version of the module may include daily lectionary from other traditions.
=head3 type
Returns `secular` for daily lectionaries based on the secular/civil calendar and `liturgical` for daily lectionaries based on the liturgical calendar.
=head3 readings
A hasref of the readings for the day.
=cut
enum 'DailyLectionary', [qw(acna-sec acna-xian)];
enum 'Tradition', [qw(acna)];
enum 'LectionaryType', [qw(secular liturgical)];
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
}
}
elsif ( $self->type eq 'secular' ) {
$self->_setReadings( _buildReadingsSecular( $self->week, $self->date, $self->lectionary ) );
}
}
=head2 _buildType
Private method to determine if the daily lectionary follows the secular calendar or the liturgical calendar.
=cut
sub _buildType {
my $lectionary = shift;
if ( $lectionary eq 'acna-xian' ) {
return 'liturgical';
}
if ( $lectionary eq 'acna-sec' ) {
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
if ( $lectDB->exists($fixed_xpath) ) {
return 1;
}
return 0;
}
=head2 _buildReadingsLiturgical
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the liturgical calendar.
=cut
sub _buildReadingsLiturgical {
my $weekName = shift;
my $weekDay = shift;
my $lectionary = shift;
my $readings = _parseLectDB($lectionary);
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
}
catch {
carp "The readings for $weekDay in $weekName in the $lectionary lectionary could not be found.";
};
return \%readings;
}
=head2 _buildReadingsSecular
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the secular calendar.
=cut
sub _buildReadingsSecular {
my $weekName = shift;
my $date = shift;
my $lectionary = shift;
my $readings = _parseLectDB($lectionary);
( run in 0.402 second using v1.01-cache-2.11-cpan-5dc5da66d9d )