Class: Punchblock::ProtocolError

Inherits:
Error
  • Object
show all
Defined in:
lib/punchblock/protocol_error.rb

Overview

This exception may be raised if a transport error is detected.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#call_idObject

Returns the value of attribute call_id



7
8
9
# File 'lib/punchblock/protocol_error.rb', line 7

def call_id
  @call_id
end

#component_idObject

Returns the value of attribute component_id



7
8
9
# File 'lib/punchblock/protocol_error.rb', line 7

def component_id
  @component_id
end

#nameObject

Returns the value of attribute name



7
8
9
# File 'lib/punchblock/protocol_error.rb', line 7

def name
  @name
end

#textObject

Returns the value of attribute text



7
8
9
# File 'lib/punchblock/protocol_error.rb', line 7

def text
  @text
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


19
20
21
# File 'lib/punchblock/protocol_error.rb', line 19

def eql?(other)
  other.is_a?(self.class) && [:name, :text, :call_id, :component_id].all? { |f| self.__send__(f) == other.__send__(f) }
end

#setup(name = nil, text = nil, call_id = nil, component_id = nil) ⇒ Object



9
10
11
12
# File 'lib/punchblock/protocol_error.rb', line 9

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

#to_sObject Also known as: inspect



14
15
16
# File 'lib/punchblock/protocol_error.rb', line 14

def to_s
  "#<#{self.class}: name=#{name.inspect} text=#{text.inspect} call_id=#{call_id.inspect} component_id=#{component_id.inspect}>"
end