Class: Nem::Fee::Transfer
- Inherits:
-
Object
- Object
- Nem::Fee::Transfer
- Defined in:
- lib/nem/fee/transfer.rb
Constant Summary collapse
- FEE_FACTOR =
0.05
Instance Method Summary collapse
-
#initialize(transaction) ⇒ Transfer
constructor
A new instance of Transfer.
- #testnet? ⇒ Boolean
-
#to_i ⇒ Integer
Fee in micro XEM.
-
#value ⇒ Integer
Fee in micro XEM.
Constructor Details
#initialize(transaction) ⇒ Transfer
Returns a new instance of Transfer.
6 7 8 |
# File 'lib/nem/fee/transfer.rb', line 6 def initialize(transaction) @transaction = transaction end |
Instance Method Details
#testnet? ⇒ Boolean
27 28 29 |
# File 'lib/nem/fee/transfer.rb', line 27 def testnet? @transaction.network == :testnet end |
#to_i ⇒ Integer
Returns fee in micro XEM.
22 23 24 |
# File 'lib/nem/fee/transfer.rb', line 22 def to_i value.to_i end |
#value ⇒ Integer
Returns fee in micro XEM.
11 12 13 14 15 16 17 18 19 |
# File 'lib/nem/fee/transfer.rb', line 11 def value tmp = if @transaction.has_mosaics? mosaics_fee else FEE_FACTOR * minimum_fee(@transaction.amount).to_i end tmp += if @transaction. tmp * 1_000_000 end |