Class: Numeric
Overview
Most - Modular Open Software Tester.
Copyright (C) 2009 Dmitrii Toksaitov
This file is part of Most.
Most is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Most is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Most. If not, see <http://www.gnu.org/licenses/>.
Instance Method Summary collapse
- #bits ⇒ Object
- #bytes ⇒ Object
- #gigabytes ⇒ Object
- #hours ⇒ Object
- #kilobytes ⇒ Object
- #megabytes ⇒ Object
- #milliseconds ⇒ Object
- #minutes ⇒ Object
- #petabytes ⇒ Object
- #seconds ⇒ Object
- #w ⇒ Object
Instance Method Details
#bits ⇒ Object
36 37 38 |
# File 'lib/most/helpers/numeric.rb', line 36 def bits() self * 8 end |
#bytes ⇒ Object
40 41 42 |
# File 'lib/most/helpers/numeric.rb', line 40 def bytes() self end |
#gigabytes ⇒ Object
52 53 54 |
# File 'lib/most/helpers/numeric.rb', line 52 def gigabytes() self * 1073741824 end |
#hours ⇒ Object
32 33 34 |
# File 'lib/most/helpers/numeric.rb', line 32 def hours() self * 3600 end |
#kilobytes ⇒ Object
44 45 46 |
# File 'lib/most/helpers/numeric.rb', line 44 def kilobytes() self * 1024 end |
#megabytes ⇒ Object
48 49 50 |
# File 'lib/most/helpers/numeric.rb', line 48 def megabytes() self * 1048576 end |
#milliseconds ⇒ Object
20 21 22 |
# File 'lib/most/helpers/numeric.rb', line 20 def milliseconds() self / 100.0 end |
#minutes ⇒ Object
28 29 30 |
# File 'lib/most/helpers/numeric.rb', line 28 def minutes() self * 60 end |
#petabytes ⇒ Object
56 57 58 |
# File 'lib/most/helpers/numeric.rb', line 56 def petabytes() self * 1099511627776 end |
#seconds ⇒ Object
24 25 26 |
# File 'lib/most/helpers/numeric.rb', line 24 def seconds() self end |
#w ⇒ Object
60 61 62 63 |
# File 'lib/most/helpers/numeric.rb', line 60 def w() result = ''; 1.upto(self) do result += ' ' end result end |