Class: TwilioConference::Client
- Inherits:
-
Object
- Object
- TwilioConference::Client
- Defined in:
- lib/twilio_conference.rb
Instance Method Summary collapse
- #create_conference(options = {}) ⇒ Object
-
#initialize(client, url, options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(client, url, options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/twilio_conference.rb', line 5 def initialize(client, url, = {}) @client = client if [:reuse_friendly_name] @url = url else params = Rack::Utils.parse_query URI(url).query if @client.account.conferences.list(:friendly_name => params["friendly_name"]).blank? @url = url else raise "Conference Name - #{params["friendly_name"]} Already Used" end end end |
Instance Method Details
#create_conference(options = {}) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/twilio_conference.rb', line 19 def create_conference( = {}) [:recipients].each do |recipient| .keys.each do |key| recipient[key] = [key] if recipient[key].blank? && key != :recipients end @client.account.calls.create(recipient.merge!(:url => @url)) end end |