Class: Twilio::REST::Intelligence::V2::OperatorContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::OperatorContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/operator.rb
Instance Method Summary collapse
-
#fetch ⇒ OperatorInstance
Fetch the OperatorInstance.
-
#initialize(version, sid) ⇒ OperatorContext
constructor
Initialize the OperatorContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ OperatorContext
Initialize the OperatorContext
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
#fetch ⇒ OperatorInstance
Fetch the OperatorInstance
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 |
#inspect ⇒ Object
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_s ⇒ Object
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 |