Class: SportDb::Model::Point

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/sportdb/play/models/point.rb

Instance Method Summary collapse

Instance Method Details

#diff_total_pos_strObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/sportdb/play/models/point.rb', line 38

def diff_total_pos_str
  ## todo: diff 2 use ⇑⇑
  #        diff 3 use ⇑⇑⇑
  #        diff 4 use ⇑⇑⇑⇑
  # etc.
  
  if diff_total_pos > 0
    "#{diff_total_pos}"
  elsif diff_total_pos < 0
    "#{diff_total_pos.abs}"
  else  # == 0
    ""
  end
end

#diff_total_pos_style_classObject



28
29
30
31
32
33
34
35
36
# File 'lib/sportdb/play/models/point.rb', line 28

def diff_total_pos_style_class
  if diff_total_pos > 0
    ' ranking-up '
  elsif diff_total_pos < 0
    ' ranking-down '
  else  # == 0
    ' '
  end
end

#round_pts_strObject



15
16
17
18
19
# File 'lib/sportdb/play/models/point.rb', line 15

def round_pts_str
  buf = ''
  round_pts.times { buf << '' }
  buf
end

#total_pts_strObject



21
22
23
24
25
# File 'lib/sportdb/play/models/point.rb', line 21

def total_pts_str
  buf = ''
  total_pts.times { buf << '' }
  buf
end