Class: Vonage::Verify2
- Inherits:
-
Namespace
- Object
- Namespace
- Vonage::Verify2
- Defined in:
- lib/vonage/verify2.rb
Defined Under Namespace
Classes: StartVerificationOptions, Workflow, WorkflowBuilder
Instance Method Summary collapse
-
#cancel_verification_request(request_id:) ⇒ Object
Cancel a verifiction.
-
#check_code(request_id:, code:) ⇒ Object
Check a supplied code against a request to see if it is valid.
-
#start_verification(brand:, workflow:, **opts) ⇒ Object
Request a verification be sent to a user.
-
#start_verification_options(**opts) ⇒ Object
Instantiate a new Vonage::Verify2::StartVerificationOptions object.
-
#workflow ⇒ Object
Instantiate a new Vonage::Verify2::Workflow object.
-
#workflow_builder ⇒ Object
Return the Vonage::Verify2::WorkflowBuilder class.
Instance Method Details
#cancel_verification_request(request_id:) ⇒ Object
Cancel a verifiction. If a verification request is still active, calling this method aborts the workflow.
65 66 67 |
# File 'lib/vonage/verify2.rb', line 65 def cancel_verification_request(request_id:) request('/v2/verify/' + request_id, type: Delete) end |
#check_code(request_id:, code:) ⇒ Object
Check a supplied code against a request to see if it is valid.
52 53 54 |
# File 'lib/vonage/verify2.rb', line 52 def check_code(request_id:, code:) request('/v2/verify/' + request_id, params: {code: code}, type: Post) end |
#start_verification(brand:, workflow:, **opts) ⇒ Object
Request a verification be sent to a user.
34 35 36 37 38 39 |
# File 'lib/vonage/verify2.rb', line 34 def start_verification(brand:, workflow:, **opts) raise ArgumentError, ':workflow must be an Array' unless workflow.is_a?(Array) raise ArgumentError, ':workflow must not be empty' if workflow.empty? request('/v2/verify/', params: opts.merge(brand: brand, workflow: workflow), type: Post) end |
#start_verification_options(**opts) ⇒ Object
Instantiate a new Vonage::Verify2::StartVerificationOptions object
79 80 81 |
# File 'lib/vonage/verify2.rb', line 79 def (**opts) StartVerificationOptions.new(**opts) end |
#workflow ⇒ Object
Instantiate a new Vonage::Verify2::Workflow object
84 85 86 |
# File 'lib/vonage/verify2.rb', line 84 def workflow Workflow.new end |
#workflow_builder ⇒ Object
Return the Vonage::Verify2::WorkflowBuilder class
89 90 91 |
# File 'lib/vonage/verify2.rb', line 89 def workflow_builder WorkflowBuilder.itself end |