Sha256: 4a4b88f79793eb5c617a022e978aa45ce3de1f8ef1dcdfe18ab85f9c5471e09c

Contents?: true

Size: 597 Bytes

Versions: 21

Compression:

Stored size: 597 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

21 entries across 21 versions & 1 rubygems

Version Path
sportdb-config-0.7.1 lib/sportdb/config/league_utils.rb
sportdb-config-0.7.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.6.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.5.3 lib/sportdb/config/league_utils.rb
sportdb-config-0.5.2 lib/sportdb/config/league_utils.rb
sportdb-config-0.5.1 lib/sportdb/config/league_utils.rb
sportdb-config-0.5.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.4.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.6 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.5 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.4 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.3 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.2 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.1 lib/sportdb/config/league_utils.rb
sportdb-config-0.3.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.2.3 lib/sportdb/config/league_utils.rb
sportdb-config-0.2.2 lib/sportdb/config/league_utils.rb
sportdb-config-0.2.1 lib/sportdb/config/league_utils.rb
sportdb-config-0.2.0 lib/sportdb/config/league_utils.rb
sportdb-config-0.1.0 lib/sportdb/config/utils/league_utils.rb