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](www.twilio.com/docs/voice/api/call-resource) the Member 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 that the member was enqueued, given in RFC 2822 format.
-
#fetch ⇒ MemberInstance
Fetch the 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
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 256 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'] == nil ? payload['position'] : payload['position'].to_i, 'uri' => payload['uri'], 'wait_time' => payload['wait_time'] == nil ? payload['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 || @properties['queue_sid'] ,'call_sid' => call_sid || @properties['call_sid'] , } end |
Instance Method Details
#call_sid ⇒ String
Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Member resource is associated with.
287 288 289 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 287 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
278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 278 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 that the member was enqueued, given in RFC 2822 format.
293 294 295 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 293 def date_enqueued @properties['date_enqueued'] end |
#fetch ⇒ MemberInstance
Fetch the MemberInstance
324 325 326 327 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 324 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
354 355 356 357 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 354 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.
299 300 301 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 299 def position @properties['position'] end |
#queue_sid ⇒ String
Returns The SID of the Queue the member is in.
317 318 319 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 317 def queue_sid @properties['queue_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
347 348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 347 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
334 335 336 337 338 339 340 341 342 343 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 334 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`.
305 306 307 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 305 def uri @properties['uri'] end |
#wait_time ⇒ String
Returns The number of seconds the member has been in the queue.
311 312 313 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 311 def wait_time @properties['wait_time'] end |