Class: Twilio::REST::Intelligence::V2::OperatorContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/operator.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ OperatorContext

Initialize the OperatorContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    A 34 character string that uniquely identifies this Operator.



148
149
150
151
152
153
154
155
156
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 148

def initialize(version, sid)
    super(version)

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/Operators/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchOperatorInstance

Fetch the OperatorInstance

Returns:



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 160

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    OperatorInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



186
187
188
189
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 186

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

#to_sObject

Provide a user friendly representation



179
180
181
182
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 179

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