Class: Numeric

Inherits:
Object show all
Defined in:
lib/ethereum/core_ext/object/truth.rb,
lib/ethereum/core_ext/numeric/denominations.rb

Constant Summary collapse

BABBAGE =
10**3
LOVELACE =
10**6
SHANNON =
10**9
SZABO =
10**12
FINNEY =
10**15
ETHER =
10**18
TURING =
2**256

Instance Method Summary collapse

Instance Method Details

#babbageObject



17
18
19
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 17

def babbage
  self * BABBAGE
end

#etherObject



37
38
39
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 37

def ether
  self * ETHER
end

#false?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ethereum/core_ext/object/truth.rb', line 44

def false?
  self == 0
end

#finneyObject



33
34
35
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 33

def finney
  self * FINNEY
end

#lovelaceObject



21
22
23
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 21

def lovelace
  self * LOVELACE
end

#shannonObject



25
26
27
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 25

def shannon
  self * SHANNON
end

#szaboObject



29
30
31
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 29

def szabo
  self * SZABO
end

#turingObject



41
42
43
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 41

def turing
  self * TURING
end

#weiObject



13
14
15
# File 'lib/ethereum/core_ext/numeric/denominations.rb', line 13

def wei
  self
end