def extract_sport_and_league(args, opts={})
      sport, league = opts[:sport], opts[:league]

      if args.size == 1 && league?(args[0])
        map = map_league_to_sport(args[0])
        sport ||= map[:sport].to_s
        league ||= map[:league].to_s
      elsif args.size == 1 && sport?(args[0])
        sport ||= args[0].to_s
        league ||= ''
      elsif !opts[:league].to_s.empty?
        map = map_league_to_sport(opts[:league])
        sport ||= map[:sport].to_s
      else
        sport ||= args[0].to_s || ''
        league ||= args[1].to_s || ''
      end

      return sport, league
    end
def extract_sport_and_league(args, opts={})
      sport, league = opts[:sport], opts[:league]

      if args.size == 1 && league?(args[0])
        map = map_league_to_sport(args[0])
        sport ||= map[:sport].to_s
        league ||= map[:league].to_s
      elsif args.size == 1 && sport?(args[0])
        sport ||= args[0].to_s
        league ||= ''
      elsif !opts[:league].to_s.empty?
        map = map_league_to_sport(opts[:league])
        sport ||= map[:sport].to_s
      else
        sport ||= args[0].to_s || ''
        league ||= args[1].to_s || ''
      end

      return sport, league
    end
Public: Get league and sport from args array. If sport or league is passed
 in the opts hash, they will override any mappings from the args Array.

 args - The Array to extract the league and sport from.
 opts - The Hash that will override all mappings if possible.

 Examples

   extract_sport_and_league([:mlb])
   # => 'baseball', 'mlb'

   extract_sport_and_league(['horse-racing'])
   # => 'horse-racing', ''

   extract_sport_and_league(['baseball', 'mlb'], sport: 'basketball')
   # => 'basketball', 'mlb'

 Returns two Strings.