Class: VoiceML::QueueMember

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/models/queues.rb

Overview

A member (call) waiting in a queue.

Constant Summary collapse

ATTRIBUTES =
%w[
  call_sid queue_sid account_sid date_enqueued wait_time position uri
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ QueueMember

Returns a new instance of QueueMember.



53
54
55
56
57
58
# File 'lib/voiceml/models/queues.rb', line 53

def initialize(attrs = {})
  ATTRIBUTES.each do |field|
    value = attrs.key?(field) ? attrs[field] : attrs[field.to_sym]
    instance_variable_set("@#{field}", value)
  end
end

Class Method Details

.from_hash(hash) ⇒ Object



60
61
62
63
64
# File 'lib/voiceml/models/queues.rb', line 60

def self.from_hash(hash)
  return nil if hash.nil?

  new(hash)
end