Class: VER::Status::Percent
- Defined in:
- lib/ver/status/percent.rb
Instance Attribute Summary
Attributes inherited from Label
#column, #format, #row, #status, #sticky, #variable, #weight
Instance Method Summary collapse
Methods inherited from Position
Methods inherited from Label
#initialize, #register, #setup, #style=, #text, #toggle, #update
Constructor Details
This class inherits a constructor from VER::Status::Label
Instance Method Details
#to_s ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ver/status/percent.rb', line 4 def to_s here = text.count(1.0, :insert, :lines) total = text.count(1.0, :end, :lines) percent = ((100.0 / total) * here).round case percent when 100, 99; 'Bot' when 0 ; 'Top' else ; '%2d%%' % percent end end |