Class: Nem::Model::Account
- Inherits:
-
Object
- Object
- Nem::Model::Account
- Includes:
- Nem::Mixin::Assignable
- Defined in:
- lib/nem/model/account.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#cosignatories ⇒ Object
readonly
Returns the value of attribute cosignatories.
-
#cosignatory_of ⇒ Object
readonly
Returns the value of attribute cosignatory_of.
-
#harvested_blocks ⇒ Object
readonly
Returns the value of attribute harvested_blocks.
-
#importance ⇒ Object
readonly
Returns the value of attribute importance.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#multisig_info ⇒ Object
readonly
Returns the value of attribute multisig_info.
-
#public_key ⇒ Object
readonly
Returns the value of attribute public_key.
-
#remote_status ⇒ Object
readonly
Returns the value of attribute remote_status.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#vested_balance ⇒ Object
readonly
Returns the value of attribute vested_balance.
Class Method Summary collapse
- .new_from_account_data(hash) ⇒ Object
- .new_from_account_meta_data(hash) ⇒ Object
- .new_from_account_meta_data_pair(hash) ⇒ Object
Methods included from Nem::Mixin::Assignable
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def address @address end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def balance @balance end |
#cosignatories ⇒ Object (readonly)
Returns the value of attribute cosignatories.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def cosignatories @cosignatories end |
#cosignatory_of ⇒ Object (readonly)
Returns the value of attribute cosignatory_of.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def cosignatory_of @cosignatory_of end |
#harvested_blocks ⇒ Object (readonly)
Returns the value of attribute harvested_blocks.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def harvested_blocks @harvested_blocks end |
#importance ⇒ Object (readonly)
Returns the value of attribute importance.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def importance @importance end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def label @label end |
#multisig_info ⇒ Object (readonly)
Returns the value of attribute multisig_info.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def multisig_info @multisig_info end |
#public_key ⇒ Object (readonly)
Returns the value of attribute public_key.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def public_key @public_key end |
#remote_status ⇒ Object (readonly)
Returns the value of attribute remote_status.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def remote_status @remote_status end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def status @status end |
#vested_balance ⇒ Object (readonly)
Returns the value of attribute vested_balance.
6 7 8 |
# File 'lib/nem/model/account.rb', line 6 def vested_balance @vested_balance end |
Class Method Details
.new_from_account_data(hash) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/nem/model/account.rb', line 58 def self.new_from_account_data(hash) multisig_info = MultisigInfo.new_from_multisig_info(hash[:multisigInfo]) new( address: hash[:address], balance: hash[:balance], vested_balance: hash[:vestedBalance], importance: hash[:importance], public_key: hash[:publicKey], label: hash[:label], harvested_blocks: hash[:harvestedBlocks], multisig_info: multisig_info ) end |
.new_from_account_meta_data(hash) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/nem/model/account.rb', line 43 def self.(hash) cosignatory_of = hash[:cosignatoryOf].map do |account| Account.new_from_account_data(account) end cosignatories = hash[:cosignatories].map do |account| Account.new_from_account_data(account) end new( cosignatory_of: cosignatory_of, cosignatories: cosignatories, status: hash[:status], remote_status: hash[:remoteStatus] ) end |
.new_from_account_meta_data_pair(hash) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/nem/model/account.rb', line 19 def self.(hash) account = hash[:account] = hash[:meta] cosignatory_of = [:cosignatoryOf].map do |a| Account.new_from_account_data(a) end cosignatories = [:cosignatories].map do |a| Account.new_from_account_data(a) end new( address: account[:address], balance: account[:balance], vested_balance: account[:vestedBalance], importance: account[:importance], public_key: account[:publicKey], label: account[:label], harvested_blocks: account[:harvestedBlocks], cosignatory_of: cosignatory_of, cosignatories: cosignatories, status: [:status], remote_status: [:remoteStatus] ) end |