Class: SportDb::Models::Point
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SportDb::Models::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
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/sportdb/play/models/point.rb', line 37 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
27 28 29 30 31 32 33 34 35 |
# File 'lib/sportdb/play/models/point.rb', line 27 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
14 15 16 17 18 |
# File 'lib/sportdb/play/models/point.rb', line 14 def round_pts_str buf = '' round_pts.times { buf << '♣' } buf end |
#total_pts_str ⇒ Object
20 21 22 23 24 |
# File 'lib/sportdb/play/models/point.rb', line 20 def total_pts_str buf = '' total_pts.times { buf << '♣' } buf end |