Class: FootStats::Live::Team
- Inherits:
-
Object
- Object
- FootStats::Live::Team
- Defined in:
- lib/foot_stats/live_team.rb
Instance Attribute Summary collapse
-
#cards ⇒ Object
readonly
Returns the value of attribute cards.
-
#coach ⇒ Object
readonly
Returns the value of attribute coach.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#goals ⇒ Object
readonly
Returns the value of attribute goals.
-
#players ⇒ Object
readonly
Returns the value of attribute players.
-
#source_id ⇒ Object
readonly
Returns the value of attribute source_id.
Instance Method Summary collapse
- #initial_players ⇒ Object
-
#initialize(params) ⇒ Team
constructor
A new instance of Team.
- #substituted_players ⇒ Object
Constructor Details
#initialize(params) ⇒ Team
Returns a new instance of Team.
7 8 9 10 11 12 13 14 15 |
# File 'lib/foot_stats/live_team.rb', line 7 def initialize(params) @coach = params['@Tecnico'] @full_name = params['@Nome'] @source_id = params['@Id'] parse_cards params['Cartoes'] parse_goals params['Gols'] parse_players params['Escalacao'] end |
Instance Attribute Details
#cards ⇒ Object (readonly)
Returns the value of attribute cards.
5 6 7 |
# File 'lib/foot_stats/live_team.rb', line 5 def cards @cards end |
#coach ⇒ Object (readonly)
Returns the value of attribute coach.
4 5 6 |
# File 'lib/foot_stats/live_team.rb', line 4 def coach @coach end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
4 5 6 |
# File 'lib/foot_stats/live_team.rb', line 4 def full_name @full_name end |
#goals ⇒ Object (readonly)
Returns the value of attribute goals.
5 6 7 |
# File 'lib/foot_stats/live_team.rb', line 5 def goals @goals end |
#players ⇒ Object (readonly)
Returns the value of attribute players.
5 6 7 |
# File 'lib/foot_stats/live_team.rb', line 5 def players @players end |
#source_id ⇒ Object (readonly)
Returns the value of attribute source_id.
4 5 6 |
# File 'lib/foot_stats/live_team.rb', line 4 def source_id @source_id end |
Instance Method Details
#initial_players ⇒ Object
17 18 19 |
# File 'lib/foot_stats/live_team.rb', line 17 def initial_players players.find_all{ |player| !player.substituted? } end |
#substituted_players ⇒ Object
21 22 23 |
# File 'lib/foot_stats/live_team.rb', line 21 def substituted_players players.find_all{ |player| player.substituted? } end |