Class: MlsStandings::Team
- Inherits:
-
Object
- Object
- MlsStandings::Team
- Defined in:
- lib/mls_standings/team.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#games_played ⇒ Object
Returns the value of attribute games_played.
-
#losses ⇒ Object
Returns the value of attribute losses.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ties ⇒ Object
Returns the value of attribute ties.
-
#wins ⇒ Object
Returns the value of attribute wins.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(team_hash) ⇒ Team
constructor
A new instance of Team.
Constructor Details
#initialize(team_hash) ⇒ Team
Returns a new instance of Team.
6 7 8 9 |
# File 'lib/mls_standings/team.rb', line 6 def initialize(team_hash) team_hash.each_key{|k| self.send("#{k}=", team_hash[k])} @@all << self end |
Instance Attribute Details
#games_played ⇒ Object
Returns the value of attribute games_played.
2 3 4 |
# File 'lib/mls_standings/team.rb', line 2 def games_played @games_played end |
#losses ⇒ Object
Returns the value of attribute losses.
2 3 4 |
# File 'lib/mls_standings/team.rb', line 2 def losses @losses end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/mls_standings/team.rb', line 2 def name @name end |
#ties ⇒ Object
Returns the value of attribute ties.
2 3 4 |
# File 'lib/mls_standings/team.rb', line 2 def ties @ties end |
#wins ⇒ Object
Returns the value of attribute wins.
2 3 4 |
# File 'lib/mls_standings/team.rb', line 2 def wins @wins end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'lib/mls_standings/team.rb', line 11 def self.all @@all end |
.create_from_scrape(team) ⇒ Object
15 16 17 |
# File 'lib/mls_standings/team.rb', line 15 def self.create_from_scrape(team) self.new(team) end |
.eastern_conf ⇒ Object
19 20 21 |
# File 'lib/mls_standings/team.rb', line 19 def self.eastern_conf self.all[0..11] end |
.western_conf ⇒ Object
23 24 25 |
# File 'lib/mls_standings/team.rb', line 23 def self.western_conf self.all[12..23] end |