Class: Twilio::REST::Supersim::V1::CommandContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/supersim/v1/command.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ CommandContext

Initialize the CommandContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Command resource to fetch.


217
218
219
220
221
222
223
# File 'lib/twilio-ruby/rest/supersim/v1/command.rb', line 217

def initialize(version, sid)
  super(version)

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

Instance Method Details

#fetchCommandInstance

Fetch the CommandInstance

Returns:


228
229
230
231
232
# File 'lib/twilio-ruby/rest/supersim/v1/command.rb', line 228

def fetch
  payload = @version.fetch('GET', @uri)

  CommandInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


243
244
245
246
# File 'lib/twilio-ruby/rest/supersim/v1/command.rb', line 243

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

#to_sObject

Provide a user friendly representation


236
237
238
239
# File 'lib/twilio-ruby/rest/supersim/v1/command.rb', line 236

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