Sha256: 2f5ca658a4a027abb9b4c8885adbcf20bb26c5de5cb55591615706fb3c183dcb

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

# encoding: utf-8


module LeagueHelper
  def basename( league, country:, season: nil )
     ## e.g. eng-england, 2011-12, 1  returns  1-premierleague
     ##
     ##  allow country code or (repo) package name
     ##    e.g. eng-england or eng
     ##         de-deutschland or de etc.

     leagues = SportDb::Import.config.leagues

     result = leagues.basename( league, country: country, season: season )

     ##
     # note: if no mapping / nothing found return league e.g. 1, 2, 3, 3a, 3b, cup(?), etc.
     result ? result : league
  end
end

module LeagueUtils
  extend LeagueHelper
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sportdb-config-0.4.1 lib/sportdb/config/league_utils.rb