Class: Sendly::Credits
- Inherits:
-
Object
- Object
- Sendly::Credits
- Defined in:
- lib/sendly/types.rb
Overview
Represents credit balance information
Instance Attribute Summary collapse
-
#available_balance ⇒ Object
readonly
Returns the value of attribute available_balance.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#reserved_balance ⇒ Object
readonly
Returns the value of attribute reserved_balance.
Instance Method Summary collapse
-
#initialize(data) ⇒ Credits
constructor
A new instance of Credits.
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_balance ⇒ Object (readonly)
Returns the value of attribute available_balance.
420 421 422 |
# File 'lib/sendly/types.rb', line 420 def available_balance @available_balance end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
420 421 422 |
# File 'lib/sendly/types.rb', line 420 def balance @balance end |
#reserved_balance ⇒ Object (readonly)
Returns the value of attribute reserved_balance.
420 421 422 |
# File 'lib/sendly/types.rb', line 420 def reserved_balance @reserved_balance end |