Class: Nem::Model::TransferTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- Nem::Model::TransferTransaction
- Defined in:
- lib/nem/model/transfer_transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#mosaics ⇒ Object
readonly
Returns the value of attribute mosaics.
-
#recipient ⇒ Object
readonly
Returns the value of attribute recipient.
Attributes inherited from Transaction
#deadline, #fee, #hash, #height, #id, #signer, #timestamp, #type, #version
Class Method Summary collapse
Methods inherited from Transaction
new_from_account_transaction, new_from_account_transaction_meta_data_pair
Methods included from Nem::Mixin::Assignable
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
4 5 6 |
# File 'lib/nem/model/transfer_transaction.rb', line 4 def amount @amount end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/nem/model/transfer_transaction.rb', line 4 def @message end |
#mosaics ⇒ Object (readonly)
Returns the value of attribute mosaics.
4 5 6 |
# File 'lib/nem/model/transfer_transaction.rb', line 4 def mosaics @mosaics end |
#recipient ⇒ Object (readonly)
Returns the value of attribute recipient.
4 5 6 |
# File 'lib/nem/model/transfer_transaction.rb', line 4 def recipient @recipient end |
Class Method Details
.new_from_transaction_meta_data_pair(hash) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/nem/model/transfer_transaction.rb', line 6 def self.(hash) transaction = hash[:transaction] attrs = (hash).merge( recipient: transaction[:recipient], amount: transaction[:amount], ) unless transaction[:message].empty? attrs[:message] = Message.(transaction[:message]) end if transaction[:mosaics] attrs[:mosaics] = transaction[:mosaics].map do |mo| Mosaic.new_from_mosaic(mo) end end new(attrs) end |