Class: SportDb::Model::Point
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SportDb::Model::Point
- Defined in:
- lib/sportdb/play/models/point.rb
Instance Method Summary collapse
- #diff_total_pos_str ⇒ Object
- #diff_total_pos_style_class ⇒ Object
- #round_pts_str ⇒ Object
- #total_pts_str ⇒ Object
Instance Method Details
#diff_total_pos_str ⇒ Object
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_class ⇒ Object
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_str ⇒ Object
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_str ⇒ Object
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 |