Class: Buda::Withdrawal

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

Overview

for handling the total balance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Withdrawal

Returns a new instance of Withdrawal.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/buda/resources/withdrawal.rb', line 13

def initialize(**kwargs)
  @id = kwargs[:id]
  @uuid = kwargs[:uuid]
  @currency = kwargs[:currency]
  @created_at = kwargs[:created_at]
  @forced_reason = kwargs[:forced_reason]
  @account_id = kwargs[:account_id]
  @user_id = kwargs[:user_id]
  @expected_execution_time = kwargs[:expected_execution_time]
  @expected_arrival_time = kwargs[:expected_arrival_time]
  @hold_execution = kwargs[:hold_execution]
  @amount = kwargs[:amount][0]
  @fee = kwargs[:fee]
  @usd_amount = kwargs[:usd_amount]
  @deposit_data = WithdrawalData.new(**kwargs[:withdrawal_data])
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def 
  @account_id
end

#amountObject (readonly)

Returns the value of attribute amount.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def currency
  @currency
end

#deposit_dataObject (readonly)

Returns the value of attribute deposit_data.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def deposit_data
  @deposit_data
end

#expected_arrival_timeObject (readonly)

Returns the value of attribute expected_arrival_time.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def expected_arrival_time
  @expected_arrival_time
end

#feeObject (readonly)

Returns the value of attribute fee.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def fee
  @fee
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def id
  @id
end

#order_idObject (readonly)

Returns the value of attribute order_id.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def order_id
  @order_id
end

#order_typeObject (readonly)

Returns the value of attribute order_type.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def order_type
  @order_type
end

#reserve_codeObject (readonly)

Returns the value of attribute reserve_code.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def reserve_code
  @reserve_code
end

#reserve_nameObject (readonly)

Returns the value of attribute reserve_name.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def reserve_name
  @reserve_name
end

#stateObject (readonly)

Returns the value of attribute state.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def state
  @state
end

#state_reasonObject (readonly)

Returns the value of attribute state_reason.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def state_reason
  @state_reason
end

#user_idObject (readonly)

Returns the value of attribute user_id.



8
9
10
# File 'lib/buda/resources/withdrawal.rb', line 8

def user_id
  @user_id
end

Instance Method Details

#inspectObject



34
35
36
# File 'lib/buda/resources/withdrawal.rb', line 34

def inspect
  "<Withdrawal #{@amount} (#{@currency})>"
end

#to_sObject



30
31
32
# File 'lib/buda/resources/withdrawal.rb', line 30

def to_s
  "#{@amount} (#{@currency})"
end