Class: BudaApi::Models::Withdrawal

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/buda_api/models.rb

Overview

Withdrawal model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#raw, #to_h, #to_json

Constructor Details

#initialize(data) ⇒ Withdrawal

Returns a new instance of Withdrawal.



264
265
266
267
268
269
270
271
272
273
# File 'lib/buda_api/models.rb', line 264

def initialize(data)
  super(data)
  @id = data["id"]
  @created_at = parse_datetime(data["created_at"])
  @amount = parse_amount(data["amount"])
  @fee = parse_amount(data["fee"])
  @currency = data["currency"]
  @state = data["state"]
  @withdrawal_data = data["withdrawal_data"]
end

Instance Attribute Details

#amount ⇒ Object (readonly)

Returns the value of attribute amount.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def amount
  @amount
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def created_at
  @created_at
end

#currency ⇒ Object (readonly)

Returns the value of attribute currency.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def currency
  @currency
end

#fee ⇒ Object (readonly)

Returns the value of attribute fee.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def fee
  @fee
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def id
  @id
end

#state ⇒ Object (readonly)

Returns the value of attribute state.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def state
  @state
end

#withdrawal_data ⇒ Object (readonly)

Returns the value of attribute withdrawal_data.



275
276
277
# File 'lib/buda_api/models.rb', line 275

def withdrawal_data
  @withdrawal_data
end

Instance Method Details

#target_address ⇒ Object



277
278
279
# File 'lib/buda_api/models.rb', line 277

def target_address
  @withdrawal_data&.dig("target_address")
end