Class: Nis::Transaction::Transfer
- Inherits:
-
Object
- Object
- Nis::Transaction::Transfer
- Includes:
- Mixin::Struct
- Defined in:
- lib/nis/transaction/transfer.rb
Overview
Constant Summary collapse
- TYPE =
257 (transfer transaction)
0x0101
Instance Attribute Summary collapse
-
#amount ⇒ Integer
The current value of amount.
-
#deadline ⇒ Integer
The current value of deadline.
-
#fee ⇒ Nis::Fee::Transfer
The current value of fee.
-
#message ⇒ Nis::Struct::Message
The current value of message.
-
#mosaics ⇒ Array <Nis::Struct::MosaicId>
The current value of mosaics.
-
#network ⇒ Symbol
The current value of network.
-
#recipient ⇒ String
The current value of recipient.
-
#signer ⇒ String
The current value of signer.
-
#timeStamp ⇒ Object
(also: #timestamp)
Returns the value of attribute timeStamp.
-
#timestamp ⇒ Integer
The newly set value.
-
#type ⇒ Integer
The current value of type.
-
#version ⇒ Integer
The current value of version.
Instance Method Summary collapse
- #has_message? ⇒ Boolean
- #has_mosaics? ⇒ Boolean
-
#initialize(recipient, amount, message = '', mosaics: [], network: :testnet) ⇒ Transfer
constructor
A new instance of Transfer.
Methods included from Mixin::Struct
Constructor Details
#initialize(recipient, amount, message = '', mosaics: [], network: :testnet) ⇒ Transfer
Returns a new instance of Transfer.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/nis/transaction/transfer.rb', line 30 def initialize(recipient, amount, = '', mosaics: [], network: :testnet) @type = TYPE @network = network @recipient = recipient @amount = amount @message = .is_a?(Nis::Struct::Message) ? : Nis::Struct::Message.new(.to_s) @fee = Nis::Fee::Transfer.new(self) @mosaics = mosaics end |
Instance Attribute Details
#amount ⇒ Integer
Returns the current value of amount.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def amount @amount end |
#deadline ⇒ Integer
Returns the current value of deadline.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def deadline @deadline end |
#fee ⇒ Nis::Fee::Transfer
Returns the current value of fee.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def fee @fee end |
#message ⇒ Nis::Struct::Message
Returns the current value of message.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def @message end |
#mosaics ⇒ Array <Nis::Struct::MosaicId>
Returns the current value of mosaics.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def mosaics @mosaics end |
#network ⇒ Symbol
Returns the current value of network.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def network @network end |
#recipient ⇒ String
Returns the current value of recipient.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def recipient @recipient end |
#signer ⇒ String
Returns the current value of signer.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def signer @signer end |
#timeStamp ⇒ Object Also known as: timestamp
Returns the value of attribute timeStamp.
21 22 23 |
# File 'lib/nis/transaction/transfer.rb', line 21 def timeStamp @timeStamp end |
#timestamp=(value) ⇒ Integer
Returns the newly set value.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def (value) @timestamp = value end |
#type ⇒ Integer
Returns the current value of type.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def type @type end |
#version ⇒ Integer
Returns the current value of version.
17 18 19 |
# File 'lib/nis/transaction/transfer.rb', line 17 def version @version end |
Instance Method Details
#has_message? ⇒ Boolean
43 44 45 |
# File 'lib/nis/transaction/transfer.rb', line 43 def @message.bytesize > 0 end |
#has_mosaics? ⇒ Boolean
47 48 49 |
# File 'lib/nis/transaction/transfer.rb', line 47 def has_mosaics? @mosaics.size > 0 end |