lib/punchblock/protocol_error.rb in punchblock-0.10.0 vs lib/punchblock/protocol_error.rb in punchblock-0.11.0
- old
+ new
@@ -4,11 +4,12 @@
##
# This exception may be raised if a transport error is detected.
class ProtocolError < StandardError
attr_accessor :name, :text, :call_id, :component_id
- def initialize(name = nil, text = nil, call_id = nil, component_id = nil)
+ def setup(name = nil, text = nil, call_id = nil, component_id = nil)
@name, @text, @call_id, @component_id = name, text, call_id, component_id
+ self
end
def to_s
"#<#{self.class}: name=#{name.inspect} text=#{text.inspect} call_id=#{call_id.inspect} component_id=#{component_id.inspect}>"
end