Class: AccountData

Inherits:
Object
  • Object
show all
Defined in:
lib/data/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ AccountData

Returns a new instance of AccountData.



35
36
37
38
39
40
# File 'lib/data/data.rb', line 35

def initialize(hash)
  digest = OpenSSL::Digest::SHA256.new
  @ledger = digest.hexdigest "1"
  @key = digest.hexdigest "#{hash}+account"
  @balance = rand 100_000_000
end

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



34
35
36
# File 'lib/data/data.rb', line 34

def balance
  @balance
end

#keyObject (readonly)

Returns the value of attribute key.



34
35
36
# File 'lib/data/data.rb', line 34

def key
  @key
end

#ledgerObject (readonly)

Returns the value of attribute ledger.



34
35
36
# File 'lib/data/data.rb', line 34

def ledger
  @ledger
end