Class: Numeric

Inherits:
Object show all
Defined in:
lib/most/helpers/numeric.rb

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

Instance Method Details

#bitsObject



36
37
38
# File 'lib/most/helpers/numeric.rb', line 36

def bits()
  self * 8
end

#bytesObject



40
41
42
# File 'lib/most/helpers/numeric.rb', line 40

def bytes()
  self
end

#gigabytesObject



52
53
54
# File 'lib/most/helpers/numeric.rb', line 52

def gigabytes()
  self * 1073741824
end

#hoursObject



32
33
34
# File 'lib/most/helpers/numeric.rb', line 32

def hours()
  self * 3600
end

#kilobytesObject



44
45
46
# File 'lib/most/helpers/numeric.rb', line 44

def kilobytes()
  self * 1024
end

#megabytesObject



48
49
50
# File 'lib/most/helpers/numeric.rb', line 48

def megabytes()
  self * 1048576
end

#millisecondsObject



20
21
22
# File 'lib/most/helpers/numeric.rb', line 20

def milliseconds()
  self / 100.0
end

#minutesObject



28
29
30
# File 'lib/most/helpers/numeric.rb', line 28

def minutes()
  self * 60
end

#petabytesObject



56
57
58
# File 'lib/most/helpers/numeric.rb', line 56

def petabytes()
  self * 1099511627776
end

#secondsObject



24
25
26
# File 'lib/most/helpers/numeric.rb', line 24

def seconds()
  self
end

#wObject



60
61
62
63
# File 'lib/most/helpers/numeric.rb', line 60

def w()
  result = ''; 1.upto(self) do result += ' ' end
  result
end