Class: ConferenceCallService::Participant

Inherits:
Object
  • Object
show all
Defined in:
lib/conference_call_service/participant.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, details, status) ⇒ Participant

Constructor



6
7
8
9
10
# File 'lib/conference_call_service/participant.rb', line 6

def initialize(id, details, status)
  @id = id
  @details = details
  @status = status
end

Instance Attribute Details

#detailsObject

Returns the value of attribute details.



3
4
5
# File 'lib/conference_call_service/participant.rb', line 3

def details
  @details
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/conference_call_service/participant.rb', line 3

def id
  @id
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/conference_call_service/participant.rb', line 3

def status
  @status
end

Class Method Details

.build_from_xml(xml_doc) ⇒ Object

Static methods



18
19
20
21
22
23
24
25
26
# File 'lib/conference_call_service/participant.rb', line 18

def self.build_from_xml(xml_doc)
  if xml_doc then
    id = ConferenceCallService.xpath_query(xml_doc, "participantId").to_s
    details = ParticipantDetails.build_from_xml( ConferenceCallService.xpath_query(xml_doc, "detail") )
    status = { :muted => ConferenceCallService.xpath_query(xml_doc, "status/value").to_s }

    new(id, details, status)
  end
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/conference_call_service/participant.rb', line 12

def to_s
  "Participant - id:#{@id.to_s} details:#{@details.to_s}, status:#{@status.to_s}"
end