Class: Sendly::Credits

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/types.rb

Overview

Represents credit balance information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Credits

Returns a new instance of Credits.



422
423
424
425
426
# File 'lib/sendly/types.rb', line 422

def initialize(data)
  @balance = data["balance"] || 0
  @reserved_balance = data["reserved_balance"] || data["reservedBalance"] || 0
  @available_balance = data["available_balance"] || data["availableBalance"] || 0
end

Instance Attribute Details

#available_balanceObject (readonly)

Returns the value of attribute available_balance.



420
421
422
# File 'lib/sendly/types.rb', line 420

def available_balance
  @available_balance
end

#balanceObject (readonly)

Returns the value of attribute balance.



420
421
422
# File 'lib/sendly/types.rb', line 420

def balance
  @balance
end

#reserved_balanceObject (readonly)

Returns the value of attribute reserved_balance.



420
421
422
# File 'lib/sendly/types.rb', line 420

def reserved_balance
  @reserved_balance
end