Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/universum/type.rb,
lib/universum/units_time.rb,
lib/universum/units_money.rb
Overview
add dummy bool class for mapping and (payable) method signature
Constant Summary collapse
- HOUR_IN_SECONDS =
note: there’s NO month (for now)!!!
why? month might be 28,29,30,31 days use days e.g. 30.days or 31.days etc. 60 * 60
- DAY_IN_SECONDS =
60 minutes * 60 seconds
24 * HOUR_IN_SECONDS
- WEEK_IN_SECONDS =
24 hours * 60 * 60
7 * DAY_IN_SECONDS
- FORTNIGHT_IN_SECONDS =
7 days * 24 * 60 * 60
14 * DAY_IN_SECONDS
- YEAR_IN_SECONDS =
14 days * 24 * 60 * 60
365 * DAY_IN_SECONDS
- E3 =
1_000
10**3
- E6 =
1_000_000
10**6
- E9 =
1_000_000_000
10**9
- E12 =
1_000_000_000_000
10**12
- E15 =
1_000_000_000_000_000
10**15
- E18 =
1_000_000_000_000_000_000
10**18
Class Method Summary collapse
Instance Method Summary collapse
-
#ada ⇒ Object
todo/check: in use, really? keep just lovelave- why? why not?.
-
#babbage ⇒ Object
alias - use alias or alias_method - why? why not?.
- #d ⇒ Object
- #day ⇒ Object
- #days ⇒ Object
- #e12 ⇒ Object
- #e15 ⇒ Object
- #e18 ⇒ Object
- #e3 ⇒ Object
- #e6 ⇒ Object
- #e9 ⇒ Object
- #eth ⇒ Object
- #ether ⇒ Object
- #finney ⇒ Object
- #fortnight ⇒ Object
- #fortnights ⇒ Object
- #gwei ⇒ Object
- #h ⇒ Object
- #hour ⇒ Object
- #hours ⇒ Object
- #kwei ⇒ Object
- #lovelace ⇒ Object
- #m ⇒ Object
- #micro ⇒ Object
- #microeth ⇒ Object
- #microether ⇒ Object
- #milli ⇒ Object
- #millieth ⇒ Object
- #milliether ⇒ Object
- #min ⇒ Object
- #mins ⇒ Object
- #minute ⇒ Object
- #minutes ⇒ Object
- #mwei ⇒ Object
- #s ⇒ Object
- #sec ⇒ Object
-
#second ⇒ Object
365 days * 24 * 60 * 60.
-
#seconds ⇒ Object
alias - use alias or alias_method - why? why not?.
- #secs ⇒ Object
- #shannon ⇒ Object
- #szabo ⇒ Object
- #w ⇒ Object
- #week ⇒ Object
- #weeks ⇒ Object
-
#wei ⇒ Object
Ethereum money units.
- #y ⇒ Object
- #year ⇒ Object
- #years ⇒ Object
Class Method Details
.zero ⇒ Object
7 |
# File 'lib/universum/type.rb', line 7 def self.zero() 0; end |
Instance Method Details
#ada ⇒ Object
todo/check: in use, really? keep just lovelave- why? why not?
53 |
# File 'lib/universum/units_money.rb', line 53 def ada() mwei; end |
#babbage ⇒ Object
alias - use alias or alias_method - why? why not?
51 |
# File 'lib/universum/units_money.rb', line 51 def babbage() kwei; end |
#d ⇒ Object
41 |
# File 'lib/universum/units_time.rb', line 41 def d() day; end |
#day ⇒ Object
20 |
# File 'lib/universum/units_time.rb', line 20 def day() self * DAY_IN_SECONDS; end |
#days ⇒ Object
40 |
# File 'lib/universum/units_time.rb', line 40 def days() day; end |
#e12 ⇒ Object
15 |
# File 'lib/universum/units_money.rb', line 15 def e12() self * E12; end |
#e15 ⇒ Object
16 |
# File 'lib/universum/units_money.rb', line 16 def e15() self * E15; end |
#e18 ⇒ Object
17 |
# File 'lib/universum/units_money.rb', line 17 def e18() self * E18; end |
#e3 ⇒ Object
12 |
# File 'lib/universum/units_money.rb', line 12 def e3() self * E3; end |
#e6 ⇒ Object
13 |
# File 'lib/universum/units_money.rb', line 13 def e6() self * E6; end |
#e9 ⇒ Object
14 |
# File 'lib/universum/units_money.rb', line 14 def e9() self * E9; end |
#eth ⇒ Object
62 |
# File 'lib/universum/units_money.rb', line 62 def eth() ether; end |
#ether ⇒ Object
47 |
# File 'lib/universum/units_money.rb', line 47 def ether() self * E18; end |
#finney ⇒ Object
56 |
# File 'lib/universum/units_money.rb', line 56 def finney() milliether; end |
#fortnight ⇒ Object
22 |
# File 'lib/universum/units_time.rb', line 22 def fortnight() self * FORTNIGHT_IN_SECONDS; end |
#fortnights ⇒ Object
46 |
# File 'lib/universum/units_time.rb', line 46 def fortnights() fortnight; end |
#gwei ⇒ Object
44 |
# File 'lib/universum/units_money.rb', line 44 def gwei() self * E9; end |
#h ⇒ Object
38 |
# File 'lib/universum/units_time.rb', line 38 def h() hour; end |
#hour ⇒ Object
19 |
# File 'lib/universum/units_time.rb', line 19 def hour() self * HOUR_IN_SECONDS; end |
#hours ⇒ Object
37 |
# File 'lib/universum/units_time.rb', line 37 def hours() hour; end |
#kwei ⇒ Object
42 |
# File 'lib/universum/units_money.rb', line 42 def kwei() self * E3; end |
#lovelace ⇒ Object
52 |
# File 'lib/universum/units_money.rb', line 52 def lovelace() mwei; end |
#m ⇒ Object
35 |
# File 'lib/universum/units_time.rb', line 35 def m() minute; end |
#micro ⇒ Object
59 |
# File 'lib/universum/units_money.rb', line 59 def micro() microether; end |
#microeth ⇒ Object
58 |
# File 'lib/universum/units_money.rb', line 58 def microeth() microether; end |
#microether ⇒ Object
45 |
# File 'lib/universum/units_money.rb', line 45 def microether() self * E12; end |
#milli ⇒ Object
61 |
# File 'lib/universum/units_money.rb', line 61 def milli() milliether; end |
#millieth ⇒ Object
60 |
# File 'lib/universum/units_money.rb', line 60 def millieth() milliether; end |
#milliether ⇒ Object
46 |
# File 'lib/universum/units_money.rb', line 46 def milliether() self * E15; end |
#min ⇒ Object
34 |
# File 'lib/universum/units_time.rb', line 34 def min() minute; end |
#mins ⇒ Object
33 |
# File 'lib/universum/units_time.rb', line 33 def mins() minute; end |
#minute ⇒ Object
18 |
# File 'lib/universum/units_time.rb', line 18 def minute() self * 60; end |
#minutes ⇒ Object
32 |
# File 'lib/universum/units_time.rb', line 32 def minutes() minute; end |
#mwei ⇒ Object
43 |
# File 'lib/universum/units_money.rb', line 43 def mwei() self * E6; end |
#s ⇒ Object
30 |
# File 'lib/universum/units_time.rb', line 30 def s() second; end |
#sec ⇒ Object
29 |
# File 'lib/universum/units_time.rb', line 29 def sec() second; end |
#second ⇒ Object
365 days * 24 * 60 * 60
17 |
# File 'lib/universum/units_time.rb', line 17 def second() self; end |
#seconds ⇒ Object
alias - use alias or alias_method - why? why not?
27 |
# File 'lib/universum/units_time.rb', line 27 def seconds() second; end |
#secs ⇒ Object
28 |
# File 'lib/universum/units_time.rb', line 28 def secs() second; end |
#shannon ⇒ Object
54 |
# File 'lib/universum/units_money.rb', line 54 def shannon() gwei; end |
#szabo ⇒ Object
55 |
# File 'lib/universum/units_money.rb', line 55 def szabo() microether; end |
#w ⇒ Object
44 |
# File 'lib/universum/units_time.rb', line 44 def w() week; end |
#week ⇒ Object
21 |
# File 'lib/universum/units_time.rb', line 21 def week() self * WEEK_IN_SECONDS; end |
#weeks ⇒ Object
43 |
# File 'lib/universum/units_time.rb', line 43 def weeks() week; end |
#wei ⇒ Object
Ethereum money units
wei 1 wei | 1
kwei (babbage) 1e3 wei | 1_000
mwei (lovelace | ada) 1e6 wei | 1_000_000
gwei (shannon) 1e9 wei | 1_000_000_000
microether (szabo) 1e12 wei | 1_000_000_000_000
milliether (finney) 1e15 wei | 1_000_000_000_000_000
ether 1e18 wei | 1_000_000_000_000_000_000
Names in Honor:
wei => Wei Dai
lovelace | ada => Ada Lovelace (1815-1852)
babbage => Charles Babbage (1791-1871)
shannon => Claude Shannon (1916-2001)
szabo => Nick Szabo
finney => Hal Finney (1956-2014)
41 |
# File 'lib/universum/units_money.rb', line 41 def wei() self; end |
#y ⇒ Object
49 |
# File 'lib/universum/units_time.rb', line 49 def y() year; end |
#year ⇒ Object
23 |
# File 'lib/universum/units_time.rb', line 23 def year() self * YEAR_IN_SECONDS; end |
#years ⇒ Object
48 |
# File 'lib/universum/units_time.rb', line 48 def years() year; end |