Class: Rubygoal::MatchData::Team

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygoal/match_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score, result, positions = nil) ⇒ Team

Returns a new instance of Team.



74
75
76
77
78
79
80
# File 'lib/rubygoal/match_data.rb', line 74

def initialize(score, result, positions = nil)
  @score  = score
  @result = result
  @positions = positions

  convert_positions_to_percentages
end

Instance Attribute Details

#positionsObject (readonly)

Returns the value of attribute positions.



72
73
74
# File 'lib/rubygoal/match_data.rb', line 72

def positions
  @positions
end

#resultObject (readonly)

Returns the value of attribute result.



72
73
74
# File 'lib/rubygoal/match_data.rb', line 72

def result
  @result
end

#scoreObject (readonly)

Returns the value of attribute score.



72
73
74
# File 'lib/rubygoal/match_data.rb', line 72

def score
  @score
end

Instance Method Details

#draw?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/rubygoal/match_data.rb', line 82

def draw?
  result == :draw
end

#losing?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/rubygoal/match_data.rb', line 90

def losing?
  result == :lose
end

#winning?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/rubygoal/match_data.rb', line 86

def winning?
  result == :win
end