League

NAME

WebService::FootballData::League - Class representing a football league

SYNOPSIS


use WebService::FootballData::League;

my $league = WebService::FootballData::League.new(
    request => WebService::FootballData::Request.new,
    links => {
        self => href => "soccerseasons/351",
        teams => href => "soccerseasons/351/teams",
        fixtures => href => "soccerseasons/351/fixtures",
        leagueTable => href => "soccerseasons/351/leagueTable"
    },
    name => '1. Bundesliga 2014/15'
);

my @teams = $league.teams;

DESCRIPTION

Class for creating objects that provide functionality for accessing league data.

leagues and league methods of WebService::FootballData make use of league objects.

ATTRIBUTES

request

An object that does the WebService::FootballData::Role::Request role.

This is a required attribute.

A hash containing links provided by football-data.org.

This is a required attribute.

name

Name of the league, of type Str.

code

Code of the league, of type Str.

season

Season of the league, of type Str.

current_matchday

Current matchday of the league, of type Int.

number_of_matchdays

Number of the matchdays of the league, of type Int.

number_of_teams

Number of the teams of the league, of type Int.

number_of_games

Number of total games of the league, of type Int.

last_updated

Date of when the league's data was updated, of type DateTime.

METHODS

id

$league.id;

Returns the league's id, of type Int.

teams

$league.teams;

Returns teams of the league: Array of WebService::FootballData::Team instances.

table

$league.table;
    $league.table: 5;

Takes optional positional argument matchday of type Int.

Returns the league's table: instance of WebService::FootballData::League::Table.

fixtures

$league.fixtures: :timeframe<p20>;
    $league.fixtures: :matchday(5);

Takes:

  • Named argument matchday of type Int.

  • Named argument timeframe of type Str. A timeframe as defined by football-data.org.

Returns the league's fixtures: Array of WebService::FootballData::Fixtures::Fixture instances.

AUTHOR

Siavash Askari Nasr - http://ciavash.name/

COPYRIGHT AND LICENSE

Copyright Ā© 2016 Siavash Askari Nasr

This file is part of WebService::FootballData.

WebService::FootballData is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

WebService::FootballData is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with WebService::FootballData. If not, see <http://www.gnu.org/licenses/>.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.