Class: AccountData
- Inherits:
-
Object
- Object
- AccountData
- Defined in:
- lib/data/data.rb
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#ledger ⇒ Object
readonly
Returns the value of attribute ledger.
Instance Method Summary collapse
-
#initialize(hash) ⇒ AccountData
constructor
A new instance of AccountData.
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
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
34 35 36 |
# File 'lib/data/data.rb', line 34 def balance @balance end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
34 35 36 |
# File 'lib/data/data.rb', line 34 def key @key end |
#ledger ⇒ Object (readonly)
Returns the value of attribute ledger.
34 35 36 |
# File 'lib/data/data.rb', line 34 def ledger @ledger end |