Class: Excoin::Account::Wallet::Deposit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deposit_data) ⇒ Deposit

Returns a new instance of Deposit.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/account/deposit.rb', line 5

def initialize(deposit_data)
  begin
    @timestamp = Time.parse(deposit_data['timestamp'])
    @currency = deposit_data['currency']
    @id = deposit_data['txid']
    @address = deposit_data['address']
    @amount = BigDecimal.new(deposit_data['amount'])
    @confirmations = deposit_data['confirmations']
    @confirmed = deposit_data['confirmed']
  rescue
    puts "Error in Excoin::Account::Deposit.initialize"
    puts deposit_data
  end
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



2
3
4
# File 'lib/account/deposit.rb', line 2

def address
  @address
end

#amountObject (readonly)

Returns the value of attribute amount.



2
3
4
# File 'lib/account/deposit.rb', line 2

def amount
  @amount
end

#confirmationsObject (readonly)

Returns the value of attribute confirmations.



2
3
4
# File 'lib/account/deposit.rb', line 2

def confirmations
  @confirmations
end

#confirmedObject (readonly)

Returns the value of attribute confirmed.



2
3
4
# File 'lib/account/deposit.rb', line 2

def confirmed
  @confirmed
end

#currencyObject (readonly)

Returns the value of attribute currency.



2
3
4
# File 'lib/account/deposit.rb', line 2

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/account/deposit.rb', line 2

def id
  @id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



2
3
4
# File 'lib/account/deposit.rb', line 2

def timestamp
  @timestamp
end