Class: SmsRu::Auth
- Inherits:
-
Object
- Object
- SmsRu::Auth
- Defined in:
- lib/sms_ru/auth.rb
Overview
Authentication checks against the account. Reached via SmsRu#auth, e.g. ‘client.auth.ok?`.
Instance Method Summary collapse
-
#initialize(request) ⇒ Auth
constructor
private
A new instance of Auth.
-
#ok? ⇒ Boolean
True when the configured api_id is valid.
Constructor Details
#initialize(request) ⇒ Auth
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 Auth.
9 10 11 |
# File 'lib/sms_ru/auth.rb', line 9 def initialize(request) @request = request end |
Instance Method Details
#ok? ⇒ Boolean
Returns true when the configured api_id is valid.
14 15 16 17 18 19 |
# File 'lib/sms_ru/auth.rb', line 14 def ok? @request.call("/auth/check") true rescue AuthError false end |