Class: Rubygoal::Match::Team
- Inherits:
-
Object
- Object
- Rubygoal::Match::Team
- Defined in:
- lib/rubygoal/match.rb
Instance Attribute Summary collapse
-
#formation ⇒ Object
readonly
Returns the value of attribute formation.
-
#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, other_formation = nil) ⇒ Team
constructor
A new instance of Team.
- #losing? ⇒ Boolean
- #winning? ⇒ Boolean
Constructor Details
#initialize(score, result, other_formation = nil) ⇒ Team
Returns a new instance of Team.
6 7 8 9 10 |
# File 'lib/rubygoal/match.rb', line 6 def initialize(score, result, other_formation = nil) @score = score @result = result @formation = other_formation end |
Instance Attribute Details
#formation ⇒ Object (readonly)
Returns the value of attribute formation.
4 5 6 |
# File 'lib/rubygoal/match.rb', line 4 def formation @formation end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/rubygoal/match.rb', line 4 def result @result end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
4 5 6 |
# File 'lib/rubygoal/match.rb', line 4 def score @score end |
Instance Method Details
#draw? ⇒ Boolean
12 13 14 |
# File 'lib/rubygoal/match.rb', line 12 def draw? result == :draw end |
#losing? ⇒ Boolean
20 21 22 |
# File 'lib/rubygoal/match.rb', line 20 def losing? result == :lose end |
#winning? ⇒ Boolean
16 17 18 |
# File 'lib/rubygoal/match.rb', line 16 def winning? result == :win end |