[Rt-commit] [svn] r1575 - Business-SLA/trunk/lib/Business
leira at pallas.eruditorum.org
leira at pallas.eruditorum.org
Wed Sep 29 00:50:22 EDT 2004
Author: leira
Date: Wed Sep 29 00:50:21 2004
New Revision: 1575
Modified:
Business-SLA/trunk/lib/Business/SLA.pm
Log:
Remaining perldoc documentation.
Modified: Business-SLA/trunk/lib/Business/SLA.pm
==============================================================================
--- Business-SLA/trunk/lib/Business/SLA.pm (original)
+++ Business-SLA/trunk/lib/Business/SLA.pm Wed Sep 29 00:50:21 2004
@@ -27,28 +27,24 @@
my $SLAObj = new Business::SLA;
- $SLAObj->Add('2 real hours', { 'RealMinutes' => 120,
- 'BusinessMinutes' => undef, });
+ $SLAObj->Add('2 real hours', ( 'RealMinutes' => 120,
+ 'BusinessMinutes' => undef, ));
- $SLAObj->Add('1 business hour', { 'RealMinutes' => 0,
- 'BusinessMinutes' => 60, });
+ $SLAObj->Add('1 business hour', ( 'RealMinutes' => 0,
+ 'BusinessMinutes' => 60, ));
- $SLAObj->Add('next business minute', { 'RealMinutes' => 0,
- 'BusinessMinutes' => 0, });
+ $SLAObj->Add('next business minute', ( 'RealMinutes' => 0,
+ 'BusinessMinutes' => 0, ));
+
+ $SLAObj->SetInHoursDefault('2 real hours');
+ $SLAObj->SetOutOfHoursDefault('1 business hour');
- $SLAObj->SetInHoursDefault($RT::_RTIR_SLA_inhours_default);
- $SLAObj->SetOutOfHoursDefault($RT::_RTIR_SLA_outofhours_default);
-
- my $hours = Business::Hours->new();
- # Get a Set::IntSpan of all the business hours in the next week.
- # use the default business hours of 9am to 6pm localtime.
- $hours->business_hours_in_timespan(Start => time(), End => time()+(86400*7));
=head1 DESCRIPTION
-This module is a simple tool for calculating business hours in a time period.
-Over time, additional functionality will be added to make it easy to calculate the number of
-business hours between arbitrary dates.
+This module is a simple tool for handling operations related to
+Service Level Agreements.
+
=head1 USAGE
@@ -61,14 +57,14 @@
=head1 SUPPORT
-Send email to bug-business-hours at rt.cpan.org
+Send email to bug-business-sla at rt.cpan.org
=head1 AUTHOR
- Jesse Vincent
+ Linda Julien
Best Practical Solutions, LLC
- jesse at cpan.org
+ julien at bestpractical.com
http://www.bestpractical.com
=head1 COPYRIGHT
@@ -82,7 +78,7 @@
=head1 SEE ALSO
-perl(1).
+perl(1), L<Business::Hours>.
=cut
@@ -96,6 +92,14 @@
return ($self);
}
+=head2 SetBusinessHours
+
+Sets the Business::Hours object for this object.
+
+Takes a Business::Hours object.
+
+=cut
+
sub SetBusinessHours {
my $self = shift;
my $bizhours = shift;
@@ -105,12 +109,26 @@
return;
}
+=head2 BusinessHours
+
+Returns the Business::Hours object.
+
+=cut
+
sub BusinessHours {
my $self = shift;
return $self->{'business_hours'};
}
+=head2 SetInHoursDefault
+
+Sets the default SLA for times inside of business hours.
+
+Takes a string which is the hash key for the desired SLA.
+
+=cut
+
sub SetInHoursDefault {
my $self = shift;
my $sla = shift;;
@@ -118,12 +136,26 @@
$self->{'in_hours_default'} = $sla;
}
+=head2 InHoursDefault
+
+Returns the default SLA for times inside of business hours.
+
+=cut
+
sub InHoursDefault {
my $self = shift;
return $self->{'in_hours_default'};
}
+=head2 SetOutOfHoursDefault
+
+Sets the default SLA for times outside of business hours.
+
+Takes a string which is the hash key for the desired SLA.
+
+=cut
+
sub SetOutOfHoursDefault {
my $self = shift;
my $sla = shift;;
@@ -131,6 +163,12 @@
$self->{'out_of_hours_default'} = $sla;
}
+=head2 OutOfHoursDefault
+
+Returns the default SLA for times outside of business hours.
+
+=cut
+
sub OutOfHoursDefault {
my $self = shift;
@@ -163,6 +201,14 @@
return 1;
}
+=head2 SLA
+
+Returns the SLA for the specified time.
+
+Takes a date in Unix time format (number of seconds since the epoch).
+
+=cut
+
sub SLA {
my $self = shift;
my $date = shift;
@@ -175,6 +221,12 @@
}
+=head2 Add
+
+Adds an SLA value. Takes a string (the hash key) and a hash.
+
+=cut
+
sub Add {
my $self = shift;
my $sla = shift;
@@ -186,6 +238,14 @@
return;
}
+=head2 AddRealMinutes
+
+The number of real minutes to add for the specified SLA.
+
+Takes the hash key for the SLA.
+
+=cut
+
sub AddRealMinutes {
my $self = shift;
my $sla = shift;
@@ -200,6 +260,14 @@
return $minutes;
}
+=head2 AddBusinessMinutes
+
+The number of business minutes to add for the specified SLA.
+
+Takes the hash key for the SLA.
+
+=cut
+
sub AddBusinessMinutes {
my $self = shift;
my $sla = shift;
@@ -220,6 +288,15 @@
return $minutes;
}
+=head2 Starts
+
+Returns the starting time, given an SLA and a date.
+
+Takes a date in Unix time format (number of seconds since the epoch)
+and the hash key for the SLA.
+
+=cut
+
sub Starts {
my $self = shift;
my $date = shift;
@@ -232,6 +309,15 @@
}
}
+=head2 Due
+
+Returns the due time, given an SLA and a date.
+
+Takes a date in Unix time format (number of seconds since the epoch)
+and the hash key for the SLA.
+
+=cut
+
sub Due {
my $self = shift;
my $date = shift;
More information about the Rt-commit
mailing list