Class: Twilio::REST::Preview::Wireless::CommandContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ CommandContext

Initialize the CommandContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)


203
204
205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/preview/wireless/command.rb', line 203

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#fetchCommandInstance

Fetch the CommandInstance

Returns:



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/twilio-ruby/rest/preview/wireless/command.rb', line 215

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



241
242
243
244
# File 'lib/twilio-ruby/rest/preview/wireless/command.rb', line 241

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

#to_sObject

Provide a user friendly representation



234
235
236
237
# File 'lib/twilio-ruby/rest/preview/wireless/command.rb', line 234

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