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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, form_type) ⇒ FormContext

Initialize the FormContext

Parameters:

  • version (Version)

    Version that contains the resource

  • form_type (FormTypes)

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



49
50
51
52
53
54
55
56
57
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 49

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:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 61

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    FormInstance.new(
        @version,
        payload,
        form_type: @solution[:form_type],
    )
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



80
81
82
83
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 80

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