Class: Nem::Model::Transaction
- Inherits:
-
Object
- Object
- Nem::Model::Transaction
- Extended by:
- Forwardable
- Includes:
- Nem::Mixin::Assignable
- Defined in:
- lib/nem/model/transaction.rb
Direct Known Subclasses
ImportanceTransferTransaction, MosaicDefinitionCreationTransaction, MosaicSupplyChangeTransaction, MultisigAggregateModificationTransaction, MultisigSignatureTransaction, MultisigTransaction, ProvisionNamespaceTransaction, TransferTransaction
Instance Attribute Summary collapse
-
#deadline ⇒ Object
readonly
Returns the value of attribute deadline.
-
#fee ⇒ Object
readonly
Returns the value of attribute fee.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#signer ⇒ Object
readonly
Returns the value of attribute signer.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
- .new_from_account_transaction(hash) ⇒ Object
- .new_from_account_transaction_meta_data_pair(hash) ⇒ Object
Methods included from Nem::Mixin::Assignable
Instance Attribute Details
#deadline ⇒ Object (readonly)
Returns the value of attribute deadline.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def deadline @deadline end |
#fee ⇒ Object (readonly)
Returns the value of attribute fee.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def fee @fee end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def hash @hash end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def height @height end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def id @id end |
#signer ⇒ Object (readonly)
Returns the value of attribute signer.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def signer @signer end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/nem/model/transaction.rb', line 9 def version @version end |
Class Method Details
.new_from_account_transaction(hash) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/nem/model/transaction.rb', line 19 def self.new_from_account_transaction(hash) ( meta: { data: nil }, transaction: hash ) end |
.new_from_account_transaction_meta_data_pair(hash) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/nem/model/transaction.rb', line 26 def self.(hash) type = hash[:transaction][:type] klass = case type when 0x0101 then TransferTransaction when 0x0801 then ImportanceTransferTransaction when 0x1001 then MultisigAggregateModificationTransaction when 0x1002 then MultisigSignatureTransaction when 0x1004 then MultisigTransaction when 0x2001 then ProvisionNamespaceTransaction when 0x4001 then MosaicDefinitionCreationTransaction when 0x4002 then MosaicSupplyChangeTransaction else raise "Undefined transaction type: #{type}" end klass.(hash) end |