Class: Worldfootball::LeagueConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/worldfootball/leagues.rb

Defined Under Namespace

Classes: LeagueItem

Instance Method Summary collapse

Constructor Details

#initializeLeagueConfig

Returns a new instance of LeagueConfig.



5
6
7
# File 'lib/worldfootball/leagues.rb', line 5

def initialize
  @table = {}
end

Instance Method Details

#[](key) ⇒ Object



119
# File 'lib/worldfootball/leagues.rb', line 119

def [](key)  @table[key.to_s.downcase]; end

#add(recs) ⇒ Object



112
113
114
115
116
117
# File 'lib/worldfootball/leagues.rb', line 112

def add( recs )
   recs.each do |rec|
      @table[ rec['key'] ] = LeagueItem.new( key: rec['key'],
                                             slug: rec['slug'] )
   end
end

#keysObject



120
# File 'lib/worldfootball/leagues.rb', line 120

def keys()   @table.keys; end

#sizeObject



121
# File 'lib/worldfootball/leagues.rb', line 121

def size()   @table.size; end