Class: SmsRu::My
- Inherits:
-
Object
- Object
- SmsRu::My
- Defined in:
- lib/sms_ru/my.rb
Overview
Account information: balance, daily limit, free quota, and approved sender names. Reached via SmsRu#my, e.g. ‘client.my.balance`.
Instance Method Summary collapse
-
#balance ⇒ Float
The current account balance, in rubles.
-
#free_limit ⇒ SmsRu::FreeLimit
The free-message allowance and today’s usage.
-
#initialize(request) ⇒ My
constructor
private
A new instance of My.
-
#limit ⇒ SmsRu::Limit
The daily sending limit and today’s usage.
-
#senders ⇒ Array<String>
The approved sender names on the account.
Constructor Details
#initialize(request) ⇒ My
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of My.
9 10 11 |
# File 'lib/sms_ru/my.rb', line 9 def initialize(request) @request = request end |
Instance Method Details
#balance ⇒ Float
Returns the current account balance, in rubles.
15 |
# File 'lib/sms_ru/my.rb', line 15 def balance = @request.call("/my/balance")["balance"] |
#free_limit ⇒ SmsRu::FreeLimit
Returns the free-message allowance and today’s usage.
23 |
# File 'lib/sms_ru/my.rb', line 23 def free_limit = FreeLimit.build(@request.call("/my/free")) |
#limit ⇒ SmsRu::Limit
Returns the daily sending limit and today’s usage.
19 |
# File 'lib/sms_ru/my.rb', line 19 def limit = Limit.build(@request.call("/my/limit")) |
#senders ⇒ Array<String>
Returns the approved sender names on the account.
27 |
# File 'lib/sms_ru/my.rb', line 27 def senders = @request.call("/my/senders")["senders"] || [] |