Class: SmsRu::CallCheck
- Inherits:
-
Object
- Object
- SmsRu::CallCheck
- Defined in:
- lib/sms_ru/call_check.rb
Overview
Authorizes a user by an incoming call from their own number: SMS.ru hands you a number, the user calls it, SMS.ru drops the call (free for the caller) and marks the check confirmed. Reached via SmsRu#callcheck.
check = client.callcheck.add("79991234567")
# show check.call_phone_pretty to the user, then poll until confirmed:
client.callcheck.status(check.check_id).confirmed?
Instance Method Summary collapse
-
#add(phone) ⇒ SmsRu::CallCheckResult
Starts a check and returns the number the user must call to authorize.
-
#initialize(request) ⇒ CallCheck
constructor
private
A new instance of CallCheck.
-
#status(check_id) ⇒ SmsRu::CallCheckStatus
Polls whether the user has placed the authorizing call yet.
Constructor Details
#initialize(request) ⇒ CallCheck
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 CallCheck.
14 15 16 |
# File 'lib/sms_ru/call_check.rb', line 14 def initialize(request) @request = request end |
Instance Method Details
#add(phone) ⇒ SmsRu::CallCheckResult
Starts a check and returns the number the user must call to authorize.
23 |
# File 'lib/sms_ru/call_check.rb', line 23 def add(phone) = CallCheckResult.build(@request.call("/callcheck/add", phone: phone.to_s)) |
#status(check_id) ⇒ SmsRu::CallCheckStatus
Polls whether the user has placed the authorizing call yet.
30 |
# File 'lib/sms_ru/call_check.rb', line 30 def status(check_id) = CallCheckStatus.build(@request.call("/callcheck/status", check_id: check_id.to_s)) |