Class: LeagueReference
- Inherits:
-
Object
- Object
- LeagueReference
- Defined in:
- lib/league_reference.rb
Constant Summary collapse
- LeaguesHash =
{ :epl => { :league_full_name => "premierleague", :top_teams => 4, :middle_teams => 5, :bottom_teams => 3 }, :championship => { :league_full_name => "championship", :top_teams => 2, :middle_teams => 6, :bottom_teams => 3 }, :spl => { :league_full_name => "scottishpremierleague", :top_teams => 1, :middle_teams => 3, :bottom_teams => 2 }, :liga => { :league_full_name => "laligafootball", :top_teams => 3, :middle_teams => 6, :bottom_teams => 3 }, :ligue => { :league_full_name => "ligue1football", :top_teams => 3, :middle_teams => 4, :bottom_teams => 3 }, :seriea => { :league_full_name => "serieafootball", :top_teams => 3, :middle_teams => 5, :bottom_teams => 3 }, :bundesliga => { :league_full_name => "bundesligafootball", :top_teams => 4, :middle_teams => 6, :bottom_teams => 3 } }
Class Attribute Summary collapse
-
.bottom_teams ⇒ Object
Returns the value of attribute bottom_teams.
-
.league_full_name ⇒ Object
Returns the value of attribute league_full_name.
-
.league_symbol ⇒ Object
Returns the value of attribute league_symbol.
-
.middle_teams ⇒ Object
Returns the value of attribute middle_teams.
-
.top_teams ⇒ Object
Returns the value of attribute top_teams.
Class Method Summary collapse
Class Attribute Details
.bottom_teams ⇒ Object
Returns the value of attribute bottom_teams.
3 4 5 |
# File 'lib/league_reference.rb', line 3 def bottom_teams @bottom_teams end |
.league_full_name ⇒ Object
Returns the value of attribute league_full_name.
3 4 5 |
# File 'lib/league_reference.rb', line 3 def league_full_name @league_full_name end |
.league_symbol ⇒ Object
Returns the value of attribute league_symbol.
3 4 5 |
# File 'lib/league_reference.rb', line 3 def league_symbol @league_symbol end |
.middle_teams ⇒ Object
Returns the value of attribute middle_teams.
3 4 5 |
# File 'lib/league_reference.rb', line 3 def middle_teams @middle_teams end |
.top_teams ⇒ Object
Returns the value of attribute top_teams.
3 4 5 |
# File 'lib/league_reference.rb', line 3 def top_teams @top_teams end |
Class Method Details
.set_league_info(league_selection) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/league_reference.rb', line 51 def self.set_league_info(league_selection) self.league_symbol = league_selection %w(league_full_name top_teams middle_teams bottom_teams).each do |attr| self.send("#{attr}=", LeaguesHash[league_symbol][attr.to_sym]) end league_selection end |