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.



501
502
503
504
505
# File 'lib/sendly/types.rb', line 501

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.



499
500
501
# File 'lib/sendly/types.rb', line 499

def available_balance
  @available_balance
end

#balanceObject (readonly)

Returns the value of attribute balance.



499
500
501
# File 'lib/sendly/types.rb', line 499

def balance
  @balance
end

#reserved_balanceObject (readonly)

Returns the value of attribute reserved_balance.



499
500
501
# File 'lib/sendly/types.rb', line 499

def reserved_balance
  @reserved_balance
end