Class: SportDb::Model::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/sportdb/play/models/game.rb

Overview

NB: extend Game model from sport.db gem

Instance Method Summary collapse

Instance Method Details

#complete_tipsObject

some methods for stats



44
# File 'lib/sportdb/play/models/game.rb', line 44

def complete_tips()   tips.complete;  end

#complete_tips_1Object



45
# File 'lib/sportdb/play/models/game.rb', line 45

def complete_tips_1() tips.complete1.order( 'score1 desc,score2 desc');  end

#complete_tips_2Object



46
# File 'lib/sportdb/play/models/game.rb', line 46

def complete_tips_2() tips.complete2.order( 'score2 desc,score1 desc');  end

#complete_tips_xObject



47
# File 'lib/sportdb/play/models/game.rb', line 47

def complete_tips_x() tips.completex.order( 'score1 desc,score2 desc');  end

#incomplete_tipsObject



49
# File 'lib/sportdb/play/models/game.rb', line 49

def incomplete_tips() tips.incomplete;  end

#job_done!Object



21
22
23
# File 'lib/sportdb/play/models/game.rb', line 21

def job_done!
  @job_running = false
end

#job_running!Object

move to sport.db gem ? why? why not?



17
18
19
# File 'lib/sportdb/play/models/game.rb', line 17

def job_running!
  @job_running = true
end

#job_running?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/sportdb/play/models/game.rb', line 25

def job_running?
  (@job_running ||= false) == true
end

#tip_12x_countObject



55
# File 'lib/sportdb/play/models/game.rb', line 55

def tip_12x_count()   tips.complete.count();  end

#tip_1_countObject



51
# File 'lib/sportdb/play/models/game.rb', line 51

def tip_1_count()     tips.complete1.count();  end

#tip_1_style_classObject



37
# File 'lib/sportdb/play/models/game.rb', line 37

def tip_1_style_class()  toto1x2 == '1' ? ' bingo ' : ' ';  end

#tip_1x2_countObject

alias for tip_12x_count // or just add/use tip_count add too??



56
# File 'lib/sportdb/play/models/game.rb', line 56

def tip_1x2_count()   tips.complete.count();  end

#tip_2_countObject



52
# File 'lib/sportdb/play/models/game.rb', line 52

def tip_2_count()     tips.complete2.count();  end

#tip_2_style_classObject



38
# File 'lib/sportdb/play/models/game.rb', line 38

def tip_2_style_class()  toto1x2 == '2' ? ' bingo ' : ' ';  end

#tip_x_countObject



53
# File 'lib/sportdb/play/models/game.rb', line 53

def tip_x_count()     tips.completex.count();  end

#tip_x_style_classObject



39
# File 'lib/sportdb/play/models/game.rb', line 39

def tip_x_style_class()  toto1x2 == 'X' ? ' bingo ' : ' ';  end