Class: Nis::Struct::TransactionMetaDataPair
- Inherits:
-
Object
- Object
- Nis::Struct::TransactionMetaDataPair
- Includes:
- Util::Assignable
- Defined in:
- lib/nis/struct/transaction_meta_data_pair.rb
Overview
Instance Attribute Summary collapse
-
#meta ⇒ Nis::Struct::TransactionMetaData
The current value of meta.
-
#transaction ⇒ Nis::Struct::Transaction
The current value of transaction.
Class Method Summary collapse
Methods included from Util::Assignable
#[], #initialize, #to_hash, #to_json
Instance Attribute Details
#meta ⇒ Nis::Struct::TransactionMetaData
Returns the current value of meta.
5 6 7 |
# File 'lib/nis/struct/transaction_meta_data_pair.rb', line 5 def @meta end |
#transaction ⇒ Nis::Struct::Transaction
Returns the current value of transaction.
5 6 7 |
# File 'lib/nis/struct/transaction_meta_data_pair.rb', line 5 def transaction @transaction end |
Class Method Details
.build(meta:, transaction:) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/nis/struct/transaction_meta_data_pair.rb', line 9 def self.build(meta:, transaction:) new( meta: TransactionMetaData.build(), transaction: build_transaction_struct(transaction) ) end |
.build_transaction_struct(data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nis/struct/transaction_meta_data_pair.rb', line 16 def self.build_transaction_struct(data) type = data[:type] klass = case type when 0x0101 then Nis::Struct::TransferTransaction when 0x0801 then Nis::Struct::ImportanceTransferTransaction when 0x1001 then Nis::Struct::MultisigAggregationModificationTransaction when 0x1002 then Nis::Struct::MultisigSignatureTransaction when 0x1004 then Nis::Struct::MultisigTransaction when 0x2001 then Nis::Struct::ProvisionNamespaceTransaction when 0x4001 then Nis::Struct::MosaicDefinitionCreationTransaction when 0x4002 then Nis::Struct::MosaicSupplyChangeTransaction else raise "Not implemented entity type: #{type}" end klass.build(data) end |