Class: Twilio::REST::Verify::V2::FormContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/verify/v2/form.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, form_type) ⇒ FormContext

Initialize the FormContext

Parameters:

  • version (Version)

    Version that contains the resource

  • form_type (form.FormTypes)

    The Type of this Form. Currently only `form-push` is supported.


74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 74

def initialize(version, form_type)
  super(version)

  # Path Solution
  @solution = {form_type: form_type, }
  @uri = "/Forms/#{@solution[:form_type]}"
end

Instance Method Details

#fetchFormInstance

Fetch the FormInstance

Returns:


85
86
87
88
89
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 85

def fetch
  payload = @version.fetch('GET', @uri)

  FormInstance.new(@version, payload, form_type: @solution[:form_type], )
end

#inspectObject

Provide a detailed, user friendly representation


100
101
102
103
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 100

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Verify.V2.FormContext #{context}>"
end

#to_sObject

Provide a user friendly representation


93
94
95
96
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 93

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Verify.V2.FormContext #{context}>"
end