class Twilio::REST::Verify::V2::FormInstance

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

Public Class Methods

new(version, payload, form_type: nil) click to toggle source

Initialize the FormInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [form.FormTypes] form_type The Type of this Form. Currently only

`form-push` is supported.

@return [FormInstance] FormInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/verify/v2/form.rb
116 def initialize(version, payload, form_type: nil)
117   super(version)
118 
119   # Marshaled Properties
120   @properties = {
121       'form_type' => payload['form_type'],
122       'forms' => payload['forms'],
123       'form_meta' => payload['form_meta'],
124       'url' => payload['url'],
125   }
126 
127   # Context
128   @instance_context = nil
129   @params = {'form_type' => form_type || @properties['form_type'], }
130 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FormContext] FormContext for this FormInstance

    # File lib/twilio-ruby/rest/verify/v2/form.rb
136 def context
137   unless @instance_context
138     @instance_context = FormContext.new(@version, @params['form_type'], )
139   end
140   @instance_context
141 end
fetch() click to toggle source

Fetch the FormInstance @return [FormInstance] Fetched FormInstance

    # File lib/twilio-ruby/rest/verify/v2/form.rb
170 def fetch
171   context.fetch
172 end
form_meta() click to toggle source

@return [Hash] Additional information for the available forms for this type.

    # File lib/twilio-ruby/rest/verify/v2/form.rb
157 def form_meta
158   @properties['form_meta']
159 end
form_type() click to toggle source

@return [form.FormTypes] The Type of this Form

    # File lib/twilio-ruby/rest/verify/v2/form.rb
145 def form_type
146   @properties['form_type']
147 end
forms() click to toggle source

@return [Hash] Object that contains the available forms for this type.

    # File lib/twilio-ruby/rest/verify/v2/form.rb
151 def forms
152   @properties['forms']
153 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/form.rb
183 def inspect
184   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
185   "<Twilio.Verify.V2.FormInstance #{values}>"
186 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/form.rb
176 def to_s
177   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
178   "<Twilio.Verify.V2.FormInstance #{values}>"
179 end
url() click to toggle source

@return [String] The URL to access the forms for this type.

    # File lib/twilio-ruby/rest/verify/v2/form.rb
163 def url
164   @properties['url']
165 end