Class: BudaApi::Models::Deposit

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

Overview

Deposit model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#raw, #to_h, #to_json

Constructor Details

#initialize(data) ⇒ Deposit

Returns a new instance of Deposit.



284
285
286
287
288
289
290
291
292
# File 'lib/buda_api/models.rb', line 284

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

Instance Attribute Details

#amount ⇒ Object (readonly)

Returns the value of attribute amount.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def amount
  @amount
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def created_at
  @created_at
end

#currency ⇒ Object (readonly)

Returns the value of attribute currency.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def currency
  @currency
end

#deposit_data ⇒ Object (readonly)

Returns the value of attribute deposit_data.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def deposit_data
  @deposit_data
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def id
  @id
end

#state ⇒ Object (readonly)

Returns the value of attribute state.



294
295
296
# File 'lib/buda_api/models.rb', line 294

def state
  @state
end

Instance Method Details

#address ⇒ Object



296
297
298
# File 'lib/buda_api/models.rb', line 296

def address
  @deposit_data&.dig("address")
end