lib/punchblock/dsl.rb in punchblock-0.4.3 vs lib/punchblock/dsl.rb in punchblock-0.5.0
- old
+ new
@@ -2,12 +2,12 @@
# DO NOT USE THIS API!
# This file is temporary, to help make testing Punchblock easier.
# THIS IS IMPERMANENT AND WILL DISAPPEAR
module Punchblock
class DSL
- def initialize(connection, call, queue) # :nodoc:
- @connection, @call, @queue = connection, call, queue
+ def initialize(client, call_id, queue) # :nodoc:
+ @client, @call_id, @queue = client, call_id, queue
end
def accept # :nodoc:
write Command::Accept.new
end
@@ -36,10 +36,10 @@
component = Component::Tropo::Say.new(type => string)
write component
component.complete_event.resource
end
- def write(msg) # :nodoc:
- @connection.write @call, msg
+ def write(command) # :nodoc:
+ @client.execute_command command, :call_id => @call_id, :async => false
end
end
end