class SitemapGenerator::Numeric

Constants

EXABYTE
GIGABYTE
KILOBYTE
MEGABYTE
PETABYTE
TERABYTE

Public Class Methods

new(number) click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 9
def initialize(number)
  @number = number
end

Public Instance Methods

byte()
Alias for: bytes
bytes() click to toggle source

Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes

# File lib/sitemap_generator/core_ext/numeric.rb, line 14
def bytes
  @number
end
Also aliased as: byte
exabyte()
Alias for: exabytes
exabytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 44
def exabytes
  @number * EXABYTE
end
Also aliased as: exabyte
gigabyte()
Alias for: gigabytes
gigabytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 29
def gigabytes
  @number * GIGABYTE
end
Also aliased as: gigabyte
kilobyte()
Alias for: kilobytes
kilobytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 19
def kilobytes
  @number * KILOBYTE
end
Also aliased as: kilobyte
megabyte()
Alias for: megabytes
megabytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 24
def megabytes
  @number * MEGABYTE
end
Also aliased as: megabyte
petabyte()
Alias for: petabytes
petabytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 39
def petabytes
  @number * PETABYTE
end
Also aliased as: petabyte
terabyte()
Alias for: terabytes
terabytes() click to toggle source
# File lib/sitemap_generator/core_ext/numeric.rb, line 34
def terabytes
  @number * TERABYTE
end
Also aliased as: terabyte