Class: Excoin::Account::Wallet::Withdrawal

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(withdrawal_data) ⇒ Withdrawal

Returns a new instance of Withdrawal.



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

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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



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

def address
  @address
end

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#confirmedObject (readonly)

Returns the value of attribute confirmed.



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

def confirmed
  @confirmed
end

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end