Class: Bagel::Tennis::Stats::Winners

Inherits:
Stat
  • Object
show all
Defined in:
lib/bagel/tennis/stats/winners.rb

Instance Attribute Summary collapse

Attributes inherited from Stat

#points

Instance Method Summary collapse

Methods inherited from Stat

#initialize

Constructor Details

This class inherits a constructor from Bagel::Tennis::Stats::Stat

Instance Attribute Details

#p1Object (readonly)

Returns the value of attribute p1.



3
4
5
# File 'lib/bagel/tennis/stats/winners.rb', line 3

def p1
  @p1
end

#p2Object (readonly)

Returns the value of attribute p2.



3
4
5
# File 'lib/bagel/tennis/stats/winners.rb', line 3

def p2
  @p2
end

Instance Method Details

#nameObject



5
6
7
# File 'lib/bagel/tennis/stats/winners.rb', line 5

def name
  'WINNERS'
end

#superiorObject



13
14
15
# File 'lib/bagel/tennis/stats/winners.rb', line 13

def superior
  [ p1 > p2, p2 > p1 ]
end

#valuesObject



9
10
11
# File 'lib/bagel/tennis/stats/winners.rb', line 9

def values
  [ p1, p2 ]
end