Class: Twilio::Conference

Inherits:
Object
  • Object
show all
Extended by:
Finder
Includes:
Resource
Defined in:
lib/twilio/conference.rb

Instance Method Summary collapse

Methods included from Finder

all, count, find

Methods included from Resource

#[], #[]=, #initialize, #inspect, #update_attributes

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Twilio::Resource

Instance Method Details

#participantsObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/twilio/conference.rb', line 6

def participants
   = self[:account_sid] if self[:connect_app_sid]
  res = self.class.get "/Accounts/#{self[:account_sid]}/Conferences/#{sid}/Participants.json", :account_sid => 
  if (400..599).include? res.code
    raise Twilio::APIError.new "Error ##{res.parsed_response['code']}: #{res.parsed_response['message']}"
  else
    res.parsed_response['participants'].map do |p|
      p['api_version'] = p['api_version'].to_s # api_version parsed as a date by http_party
      Twilio::Participant.new p
    end
  end
end