Class: Verifalia::Credits::Balance
- Inherits:
-
Object
- Object
- Verifalia::Credits::Balance
- Defined in:
- lib/verifalia/credits/balance.rb
Overview
The credits balance for the Verifalia account.
Instance Attribute Summary collapse
-
#credit_packs ⇒ Object
readonly
The number of credit packs (that is, non-expiring credits) available for the account.
-
#free_credits ⇒ Object
readonly
The number of free daily credits of the account, where available.
-
#free_credits_reset_in ⇒ Object
readonly
A string representing the amount of time before the daily credits expire, where available, expressed in the form
hh:mm:ss
.
Class Method Summary collapse
-
.from_json(data) ⇒ Object
Parse a Balance from a JSON string.
Instance Method Summary collapse
-
#initialize(credit_packs, free_credits, free_credits_reset_in) ⇒ Balance
constructor
A new instance of Balance.
Constructor Details
#initialize(credit_packs, free_credits, free_credits_reset_in) ⇒ Balance
Returns a new instance of Balance.
45 46 47 48 49 |
# File 'lib/verifalia/credits/balance.rb', line 45 def initialize(credit_packs, free_credits, free_credits_reset_in) @credit_packs = credit_packs @free_credits = free_credits @free_credits_reset_in = free_credits_reset_in end |
Instance Attribute Details
#credit_packs ⇒ Object (readonly)
The number of credit packs (that is, non-expiring credits) available for the account.
37 38 39 |
# File 'lib/verifalia/credits/balance.rb', line 37 def credit_packs @credit_packs end |
#free_credits ⇒ Object (readonly)
The number of free daily credits of the account, where available.
40 41 42 |
# File 'lib/verifalia/credits/balance.rb', line 40 def free_credits @free_credits end |
#free_credits_reset_in ⇒ Object (readonly)
A string representing the amount of time before the daily credits expire, where available, expressed in the form hh:mm:ss
.
43 44 45 |
# File 'lib/verifalia/credits/balance.rb', line 43 def free_credits_reset_in @free_credits_reset_in end |