Class: Twilio::REST::FlexApi::V1::AssessmentsContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/assessments.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, assessment_sid) ⇒ AssessmentsContext

Initialize the AssessmentsContext



197
198
199
200
201
202
203
204
205
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 197

def initialize(version, assessment_sid)
    super(version)

    # Path Solution
    @solution = { assessment_sid: assessment_sid,  }
    @uri = "/Insights/QualityManagement/Assessments/#{@solution[:assessment_sid]}"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



246
247
248
249
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 246

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

#to_sObject

Provide a user friendly representation



239
240
241
242
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 239

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

#update(offset: nil, answer_text: nil, answer_id: nil, authorization: :unset) ⇒ AssessmentsInstance

Update the AssessmentsInstance



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 213

def update(
    offset: nil, 
    answer_text: nil, 
    answer_id: nil, 
    authorization: :unset
)

    data = Twilio::Values.of({
        'Offset' => offset,
        'AnswerText' => answer_text,
        'AnswerId' => answer_id,
    })

    
    headers = Twilio::Values.of({ 'Authorization' => authorization, })
    payload = @version.update('POST', @uri, data: data, headers: headers)
    AssessmentsInstance.new(
        @version,
        payload,
        assessment_sid: @solution[:assessment_sid],
    )
end