Class: Subscriber::Client::ErrorResponse
- Inherits:
-
Object
- Object
- Subscriber::Client::ErrorResponse
- Defined in:
- lib/nchan_tools/pubsub.rb
Instance Attribute Summary collapse
-
#bundle ⇒ Object
Returns the value of attribute bundle.
-
#caller ⇒ Object
Returns the value of attribute caller.
-
#code ⇒ Object
Returns the value of attribute code.
-
#connected ⇒ Object
Returns the value of attribute connected.
-
#msg ⇒ Object
Returns the value of attribute msg.
Instance Method Summary collapse
-
#initialize(code, msg, bundle = nil, what = nil, failword = nil) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(code, msg, bundle = nil, what = nil, failword = nil) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
257 258 259 260 261 262 263 264 265 |
# File 'lib/nchan_tools/pubsub.rb', line 257 def initialize(code, msg, bundle=nil, what=nil, failword=nil) self.code = code self.msg = msg self.bundle = bundle self.connected = bundle.connected? if bundle @what = what || ["handshake", "connection"] @failword = failword || " failed" end |
Instance Attribute Details
#bundle ⇒ Object
Returns the value of attribute bundle.
256 257 258 |
# File 'lib/nchan_tools/pubsub.rb', line 256 def bundle @bundle end |
#caller ⇒ Object
Returns the value of attribute caller.
256 257 258 |
# File 'lib/nchan_tools/pubsub.rb', line 256 def caller @caller end |
#code ⇒ Object
Returns the value of attribute code.
256 257 258 |
# File 'lib/nchan_tools/pubsub.rb', line 256 def code @code end |
#connected ⇒ Object
Returns the value of attribute connected.
256 257 258 |
# File 'lib/nchan_tools/pubsub.rb', line 256 def connected @connected end |
#msg ⇒ Object
Returns the value of attribute msg.
256 257 258 |
# File 'lib/nchan_tools/pubsub.rb', line 256 def msg @msg end |
Instance Method Details
#to_s ⇒ Object
267 268 269 |
# File 'lib/nchan_tools/pubsub.rb', line 267 def to_s "#{(caller.class.name.split('::').last || self.class.name.split('::')[-2])} #{connected ? @what.last : @what.first}#{@failword}: #{msg} (code #{code})" end |