Class: Twilio::REST::Authy::V1::FormContext

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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. One of ‘form-app-push`, `form-sms` or `form-totp`.



74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/authy/v1/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 a FormInstance

Returns:



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 85

def fetch
  params = Twilio::Values.of({})

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

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

#inspectObject

Provide a detailed, user friendly representation



106
107
108
109
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 106

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

#to_sObject

Provide a user friendly representation



99
100
101
102
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 99

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