| 1 | package WWW::YahooJapan::Baseball; | ||||||||||
| 2 | 1 | ▶ | use 5.008001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use WWW::YahooJapan::Baseball::Game; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use WWW::YahooJapan::Baseball::Parser; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use URI; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | our $VERSION = "0.04"; | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 14 | 0 | my ($class, %self) = @_; | |||||||||
| 15 | 0 | for my $required (qw/date league/) { | |||||||||
| 16 | 0 | ▶ | unless (defined $self{$required}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | return undef; | |||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||
| 20 | 0 | ▶ | unless (defined $self{prefix}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | $self{prefix} = 'http://baseball.yahoo.co.jp'; | |||||||||
| 22 | } | ||||||||||
| 23 | 0 | bless \%self, $class; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub games { | ||||||||
|
Subroutine
games: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 27 | 0 | my $self = shift; | |||||||||
| 28 | 0 | my $uri = URI->new($self->{prefix} . '/npb/schedule/?date=' . $self->{date}); | |||||||||
| 29 | 0 | my @game_uris = WWW::YahooJapan::Baseball::Parser::parse_games_page($self->{date}, $self->{league}, uri => $uri); | |||||||||
| 30 | 0 | map { WWW::YahooJapan::Baseball::Game->new(uri => $_) } @game_uris; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | __END__ | ||||||||||