Class: Twilio::REST::Api::V2010::AccountContext::QueueContext::MemberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::QueueContext::MemberInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/queue/member.rb
Instance Method Summary collapse
-
#call_sid ⇒ String
The SID of the Call the resource is associated with.
-
#context ⇒ MemberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_enqueued ⇒ Time
The date the member was enqueued.
-
#fetch ⇒ MemberInstance
Fetch a MemberInstance.
-
#initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) ⇒ MemberInstance
constructor
Initialize the MemberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#position ⇒ String
This member’s current position in the queue.
-
#queue_sid ⇒ String
The SID of the Queue the member is in.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(url: nil, method: :unset) ⇒ MemberInstance
Update the MemberInstance.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
-
#wait_time ⇒ String
The number of seconds the member has been in the queue.
Constructor Details
#initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) ⇒ MemberInstance
Initialize the MemberInstance
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 248 def initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) super(version) # Marshaled Properties @properties = { 'call_sid' => payload['call_sid'], 'date_enqueued' => Twilio.deserialize_rfc2822(payload['date_enqueued']), 'position' => payload['position'].to_i, 'uri' => payload['uri'], 'wait_time' => payload['wait_time'].to_i, 'queue_sid' => payload['queue_sid'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid, 'queue_sid' => queue_sid, 'call_sid' => call_sid || @properties['call_sid'], } end |
Instance Method Details
#call_sid ⇒ String
Returns The SID of the Call the resource is associated with.
288 289 290 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 288 def call_sid @properties['call_sid'] end |
#context ⇒ MemberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 274 def context unless @instance_context @instance_context = MemberContext.new( @version, @params['account_sid'], @params['queue_sid'], @params['call_sid'], ) end @instance_context end |
#date_enqueued ⇒ Time
Returns The date the member was enqueued.
294 295 296 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 294 def date_enqueued @properties['date_enqueued'] end |
#fetch ⇒ MemberInstance
Fetch a MemberInstance
325 326 327 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 325 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
349 350 351 352 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 349 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MemberInstance #{values}>" end |
#position ⇒ String
Returns This member’s current position in the queue.
300 301 302 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 300 def position @properties['position'] end |
#queue_sid ⇒ String
Returns The SID of the Queue the member is in.
318 319 320 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 318 def queue_sid @properties['queue_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 342 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MemberInstance #{values}>" end |
#update(url: nil, method: :unset) ⇒ MemberInstance
Update the MemberInstance
336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 336 def update(url: nil, method: :unset) context.update(url: url, method: method, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
306 307 308 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 306 def uri @properties['uri'] end |
#wait_time ⇒ String
Returns The number of seconds the member has been in the queue.
312 313 314 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 312 def wait_time @properties['wait_time'] end |