Class: Rubygoal::Match::Team

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formationObject (readonly)

Returns the value of attribute formation.



4
5
6
# File 'lib/rubygoal/match.rb', line 4

def formation
  @formation
end

#resultObject (readonly)

Returns the value of attribute result.



4
5
6
# File 'lib/rubygoal/match.rb', line 4

def result
  @result
end

#scoreObject (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

Returns:

  • (Boolean)


12
13
14
# File 'lib/rubygoal/match.rb', line 12

def draw?
  result == :draw
end

#losing?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rubygoal/match.rb', line 20

def losing?
  result == :lose
end

#winning?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rubygoal/match.rb', line 16

def winning?
  result == :win
end