Class: Rubygoal::MatchData::Team
- Inherits:
-
Object
- Object
- Rubygoal::MatchData::Team
- Defined in:
- lib/rubygoal/match_data.rb
Instance Attribute Summary collapse
-
#positions ⇒ Object
readonly
Returns the value of attribute positions.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
- #draw? ⇒ Boolean
-
#initialize(score, result, positions = nil) ⇒ Team
constructor
A new instance of Team.
- #losing? ⇒ Boolean
- #winning? ⇒ Boolean
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
#positions ⇒ Object (readonly)
Returns the value of attribute positions.
72 73 74 |
# File 'lib/rubygoal/match_data.rb', line 72 def positions @positions end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
72 73 74 |
# File 'lib/rubygoal/match_data.rb', line 72 def result @result end |
#score ⇒ Object (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
82 83 84 |
# File 'lib/rubygoal/match_data.rb', line 82 def draw? result == :draw end |
#losing? ⇒ Boolean
90 91 92 |
# File 'lib/rubygoal/match_data.rb', line 90 def losing? result == :lose end |
#winning? ⇒ Boolean
86 87 88 |
# File 'lib/rubygoal/match_data.rb', line 86 def winning? result == :win end |