Class: Twilio::REST::Preview::Understand::ServiceContext::IntentContext::FieldContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Understand::ServiceContext::IntentContext::FieldContext
- Defined in:
- lib/twilio-ruby/rest/preview/understand/service/intent/field.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
-
#delete ⇒ Boolean
Deletes the FieldInstance.
-
#fetch ⇒ FieldInstance
Fetch a FieldInstance.
-
#initialize(version, service_sid, intent_sid, sid) ⇒ FieldContext
constructor
Initialize the FieldContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, intent_sid, sid) ⇒ FieldContext
Initialize the FieldContext
188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/preview/understand/service/intent/field.rb', line 188 def initialize(version, service_sid, intent_sid, sid) super(version) # Path Solution @solution = {service_sid: service_sid, intent_sid: intent_sid, sid: sid} @uri = "/Services/#{@solution[:service_sid]}/Intents/#{@solution[:intent_sid]}/Fields/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the FieldInstance
220 221 222 |
# File 'lib/twilio-ruby/rest/preview/understand/service/intent/field.rb', line 220 def delete @version.delete('delete', @uri) end |
#fetch ⇒ FieldInstance
Fetch a FieldInstance
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/preview/understand/service/intent/field.rb', line 199 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FieldInstance.new( @version, payload, service_sid: @solution[:service_sid], intent_sid: @solution[:intent_sid], sid: @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
226 227 228 229 |
# File 'lib/twilio-ruby/rest/preview/understand/service/intent/field.rb', line 226 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Understand.FieldContext #{context}>" end |