Class: Twilio::REST::Verify::V2::FormInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::FormInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/form.rb
Instance Method Summary collapse
-
#context ⇒ FormContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ FormInstance
Fetch the FormInstance.
-
#form_meta ⇒ Hash
Additional information for the available forms for this type.
- #form_type ⇒ FormTypes
-
#forms ⇒ Hash
Object that contains the available forms for this 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 type.
Constructor Details
#initialize(version, payload, form_type: nil) ⇒ FormInstance
Initialize the FormInstance
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 127 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
147 148 149 150 151 152 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 147 def context unless @instance_context @instance_context = FormContext.new(@version , @params['form_type']) end @instance_context end |
#fetch ⇒ FormInstance
Fetch the FormInstance
181 182 183 184 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 181 def fetch context.fetch end |
#form_meta ⇒ Hash
Returns Additional information for the available forms for this type. E.g. The separator string used for ‘binding` in a Factor push.
168 169 170 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 168 def @properties['form_meta'] end |
#form_type ⇒ FormTypes
156 157 158 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 156 def form_type @properties['form_type'] end |
#forms ⇒ Hash
Returns Object that contains the available forms for this type. This available forms are given in the standard [JSON Schema](json-schema.org/) format.
162 163 164 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 162 def forms @properties['forms'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
195 196 197 198 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 195 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.FormInstance #{values}>" end |
#to_s ⇒ Object
Provide a user friendly representation
188 189 190 191 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 188 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.FormInstance #{values}>" end |
#url ⇒ String
Returns The URL to access the forms for this type.
174 175 176 |
# File 'lib/twilio-ruby/rest/verify/v2/form.rb', line 174 def url @properties['url'] end |