Class: SimulatorClassification

Inherits:
Object
  • Object
show all
Defined in:
app/models/simulator_classification.rb

Instance Method Summary collapse

Constructor Details

#initialize(championship) ⇒ SimulatorClassification

Returns a new instance of SimulatorClassification.



4
5
6
# File 'app/models/simulator_classification.rb', line 4

def initialize(championship)
  @championship = championship
end

Instance Method Details

#cupObject



32
33
34
35
36
37
38
# File 'app/models/simulator_classification.rb', line 32

def cup
  if last_match
    last_match.cup
  else
    ''
  end
end

#phaseObject



24
25
26
27
28
29
30
# File 'app/models/simulator_classification.rb', line 24

def phase
  if last_match
    last_match.phase
  else
    'Primeira Fase'
  end
end

#roundObject



16
17
18
19
20
21
22
# File 'app/models/simulator_classification.rb', line 16

def round
  if last_match
    last_match.round
  else
    1
  end
end

#to_foot_statsObject



8
9
10
11
12
13
14
# File 'app/models/simulator_classification.rb', line 8

def to_foot_stats
  if @championship.has_classification?
    championship_classification
  else
    classification_missing
  end
end