Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding Call#remove_tag

  • Loading branch information...
commit b65a72052d0e8c570fee3007b053efcbd0696fd2 1 parent e4c09a7
Jay Phillips authored
View
7 lib/adhearsion/voip/call.rb
@@ -88,7 +88,6 @@ def initialize(call)
end
end
-
class FailedExtensionCallException < MetaAgiCallException; end
class HungupExtensionCallException < MetaAgiCallException; end
@@ -167,6 +166,12 @@ def tag(symbol)
end
end
+ def remove_tag(symbol)
+ @tag_mutex.synchronize do
+ @tags.reject! { |tag| tag == symbol }
+ end
+ end
+
def tagged_with?(symbol)
@tag_mutex.synchronize do
@tags.include? symbol
View
9 spec/voip/test_dialplan_manager.rb
@@ -123,6 +123,15 @@ def mock_dial_plan_lookup_for_context_name
call.tagged_with?(:authorized).should.equal false
end
+ test "Call#remove_tag" do
+ call = new_call_for_context "roflcopter"
+ call.tag :moderator
+ call.tag :female
+ call.remove_tag :female
+ call.tag :male
+ call.tags.should == [:moderator, :male]
+ end
+
test 'Call#tagged_with? with many tags' do
call = new_call_for_context "roflcopter"
call.tag :customer
Please sign in to comment.
Something went wrong with that request. Please try again.