Class: Twilio::REST::Authy::V1::FormInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Authy::V1::FormInstance
- 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
-
#context ⇒ FormContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ FormInstance
Fetch a FormInstance.
-
#form_meta ⇒ Hash
Additional information for the available forms for this form type.
-
#form_type ⇒ form.FormType
The Form Type of this Form.
-
#forms ⇒ Hash
Object that contains the available forms for this form type.
-
#initialize(version, payload, form_type: nil) ⇒ FormInstance
constructor
Initialize the FormInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL to access the forms for this form type.
Constructor Details
#initialize(version, payload, form_type: nil) ⇒ FormInstance
Initialize the FormInstance
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 115 def initialize(version, payload, form_type: nil) super(version) # Marshaled Properties @properties = { 'form_type' => payload['form_type'], 'forms' => payload['forms'], 'form_meta' => payload['form_meta'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'form_type' => form_type || @properties['form_type'], } end |
Instance Method Details
#context ⇒ FormContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
135 136 137 138 139 140 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 135 def context unless @instance_context @instance_context = FormContext.new(@version, @params['form_type'], ) end @instance_context end |
#fetch ⇒ FormInstance
Fetch a FormInstance
169 170 171 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 169 def fetch context.fetch end |
#form_meta ⇒ Hash
Returns Additional information for the available forms for this form type.
156 157 158 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 156 def @properties['form_meta'] end |
#form_type ⇒ form.FormType
Returns The Form Type of this Form.
144 145 146 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 144 def form_type @properties['form_type'] end |
#forms ⇒ Hash
Returns Object that contains the available forms for this form type.
150 151 152 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 150 def forms @properties['forms'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
182 183 184 185 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 182 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Authy.V1.FormInstance #{values}>" end |
#to_s ⇒ Object
Provide a user friendly representation
175 176 177 178 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 175 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Authy.V1.FormInstance #{values}>" end |
#url ⇒ String
Returns The URL to access the forms for this form type.
162 163 164 |
# File 'lib/twilio-ruby/rest/authy/v1/form.rb', line 162 def url @properties['url'] end |