Class: SportDb::Models::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



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

def complete_tips()   tips.complete;  end

#complete_tips_1Object



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

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

#complete_tips_2Object



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

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

#complete_tips_xObject



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

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

#incomplete_tipsObject



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

def incomplete_tips() tips.incomplete;  end

#job_done!Object



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

def job_done!
  @job_running = false
end

#job_running!Object

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



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

def job_running!
  @job_running = true
end

#job_running?Boolean

Returns:

  • (Boolean)


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

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

#tip_12x_countObject



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

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

#tip_1_countObject



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

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

#tip_1_style_classObject



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

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??



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

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

#tip_2_countObject



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

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

#tip_2_style_classObject



40
41
42
# File 'lib/sportdb/play/models/game.rb', line 40

def tip_2_style_class
  toto1x2 == '2' ? ' bingo ' : ' '
end

#tip_x_countObject



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

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

#tip_x_style_classObject



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

def tip_x_style_class
  toto1x2 == 'X' ? ' bingo ' : ' '
end