Class: Remitmd::SpendingSummary

Inherits:
Model
  • Object
show all
Defined in:
lib/remitmd/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#inspect, #to_h

Constructor Details

#initialize(attrs) ⇒ SpendingSummary

Returns a new instance of SpendingSummary.



381
382
383
384
385
386
387
388
389
# File 'lib/remitmd/models.rb', line 381

def initialize(attrs)
  h = attrs.transform_keys(&:to_s)
  @address        = h["address"]
  @period         = h["period"]
  @total_spent    = decimal(h["total_spent"])
  @total_fees     = decimal(h["total_fees"])
  @tx_count       = h["tx_count"].to_i
  @top_recipients = h["top_recipients"] || []
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def address
  @address
end

#periodObject (readonly)

Returns the value of attribute period.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def period
  @period
end

#top_recipientsObject (readonly)

Returns the value of attribute top_recipients.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def top_recipients
  @top_recipients
end

#total_feesObject (readonly)

Returns the value of attribute total_fees.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def total_fees
  @total_fees
end

#total_spentObject (readonly)

Returns the value of attribute total_spent.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def total_spent
  @total_spent
end

#tx_countObject (readonly)

Returns the value of attribute tx_count.



391
392
393
# File 'lib/remitmd/models.rb', line 391

def tx_count
  @tx_count
end