Class: Nem::Model::Account

Inherits:
Object
  • Object
show all
Includes:
Nem::Mixin::Assignable
Defined in:
lib/nem/model/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def address
  @address
end

#balanceObject (readonly)

Returns the value of attribute balance.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def balance
  @balance
end

#cosignatoriesObject (readonly)

Returns the value of attribute cosignatories.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def cosignatories
  @cosignatories
end

#cosignatory_ofObject (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_blocksObject (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

#importanceObject (readonly)

Returns the value of attribute importance.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def importance
  @importance
end

#labelObject (readonly)

Returns the value of attribute label.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def label
  @label
end

#multisig_infoObject (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_keyObject (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_statusObject (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

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/nem/model/account.rb', line 6

def status
  @status
end

#vested_balanceObject (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.(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.()
  end
  cosignatories = hash[:cosignatories].map do ||
    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)
   = hash[:account]
  meta = hash[:meta]
  cosignatory_of = meta[:cosignatoryOf].map do |a|
    Account.(a)
  end
  cosignatories = meta[:cosignatories].map do |a|
    Account.(a)
  end
  new(
    address: [:address],
    balance: [:balance],
    vested_balance: [:vestedBalance],
    importance: [:importance],
    public_key: [:publicKey],
    label: [:label],
    harvested_blocks: [:harvestedBlocks],
    cosignatory_of: cosignatory_of,
    cosignatories: cosignatories,
    status: meta[:status],
    remote_status: meta[:remoteStatus]
  )
end