Class: Twilio::REST::Wireless::V1::CommandContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Wireless::V1::CommandContext
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/command.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CommandInstance.
-
#fetch ⇒ CommandInstance
Fetch the CommandInstance.
-
#initialize(version, sid) ⇒ CommandContext
constructor
Initialize the CommandContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ CommandContext
Initialize the CommandContext
193 194 195 196 197 198 199 200 201 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 193 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Commands/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CommandInstance
205 206 207 208 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 205 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ CommandInstance
Fetch the CommandInstance
213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 213 def fetch payload = @version.fetch('GET', @uri) CommandInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 233 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Wireless.V1.CommandContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
226 227 228 229 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 226 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Wireless.V1.CommandContext #{context}>" end |