| 1 | package HTTP::Headers::ActionPack::DateHeader; | ||
| 2 | # ABSTRACT: A Date Header | ||
| 3 | |||
| 4 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 6 | our $VERSION = '0.10'; | |
| 8 | |||
| 9 | 6 | ▶ | use HTTP::Headers::ActionPack::Util qw[ |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | header_to_date | ||
| 11 | date_to_header | ||
| 12 | 6 | ]; | |
| 13 | |||
| 14 | 6 | ▶ | use parent 'HTTP::Headers::ActionPack::Core::Base'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 9 | ▶ | sub BUILDARGS { |
|
Subroutine
BUILDARGS: called CC=1 SCAR=0.0
Pod
documented
| |||
| 17 | 9 | my (undef, $date) = @_; | |
| 18 | 9 | +{ date => $date } | |
| 19 | } | ||
| 20 | |||
| 21 | 8 | ▶ | sub new_from_string { |
|
Subroutine
new_from_string: called CC=1 SCAR=0.0
Pod
documented
| |||
| 22 | 8 | my ($class, $header_string) = @_; | |
| 23 | 8 | $class->new( header_to_date( $header_string ) ); | |
| 24 | } | ||
| 25 | |||
| 26 | 15 | ▶ | sub as_string { date_to_header( (shift)->{'date'} ) } |
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||
| 27 | |||
| 28 | # implement a simple API | ||
| 29 | 2 | ▶ | sub second { (shift)->{'date'}->second } |
|
Subroutine
second: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 2 | ▶ | sub minute { (shift)->{'date'}->minute } |
|
Subroutine
minute: called CC=1 SCAR=0.0
Pod
documented
| |||
| 31 | 2 | ▶ | sub hour { (shift)->{'date'}->hour } |
|
Subroutine
hour: called CC=1 SCAR=0.0
Pod
documented
| |||
| 32 | 0 | ▶ | sub day_of_month { (shift)->{'date'}->day_of_month } |
|
Subroutine
day_of_month: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | ▶ | sub month_number { (shift)->{'date'}->mon } |
|
Subroutine
month_number: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 34 | 0 | ▶ | sub fullmonth { (shift)->{'date'}->fullmonth } |
|
Subroutine
fullmonth: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 35 | 2 | ▶ | sub month { (shift)->{'date'}->month } |
|
Subroutine
month: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | 2 | ▶ | sub year { (shift)->{'date'}->year } |
|
Subroutine
year: called CC=1 SCAR=0.0
Pod
documented
| |||
| 37 | 0 | ▶ | sub day_of_week { (shift)->{'date'}->day_of_week } |
|
Subroutine
day_of_week: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 38 | 2 | ▶ | sub day { (shift)->{'date'}->day } |
|
Subroutine
day: called CC=1 SCAR=0.0
Pod
documented
| |||
| 39 | 0 | ▶ | sub fullday { (shift)->{'date'}->fullday } |
|
Subroutine
fullday: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | 0 | ▶ | sub epoch { (shift)->{'date'}->epoch } |
|
Subroutine
epoch: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 41 | |||
| 42 | 0 | ▶ | sub date { (shift)->{'date'} } |
|
Subroutine
date: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 43 | |||
| 44 | 6 | 1; | |
| 45 | |||
| 46 | __END__ | ||