Exception: Wamp::Client::Response::CallError
- Inherits:
-
StandardError
- Object
- StandardError
- Wamp::Client::Response::CallError
- Defined in:
- lib/wamp/client/response.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error, args = nil, kwargs = nil) ⇒ CallError
constructor
A new instance of CallError.
- #to_hash ⇒ Object
Constructor Details
#initialize(error, args = nil, kwargs = nil) ⇒ CallError
Returns a new instance of CallError.
82 83 84 85 86 |
# File 'lib/wamp/client/response.rb', line 82 def initialize(error, args=nil, kwargs=nil) @error = error @args = args || [] @kwargs = kwargs || {} end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
80 81 82 |
# File 'lib/wamp/client/response.rb', line 80 def args @args end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
80 81 82 |
# File 'lib/wamp/client/response.rb', line 80 def error @error end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
80 81 82 |
# File 'lib/wamp/client/response.rb', line 80 def kwargs @kwargs end |
Class Method Details
.ensure(result) ⇒ Object
100 101 102 103 104 105 106 107 |
# File 'lib/wamp/client/response.rb', line 100 def self.ensure(result) unless result.is_a?(self) args = result != nil ? [result] : nil result = self.new(DEFAULT_ERROR, args) end result end |
.from_hash(hash) ⇒ Object
88 89 90 |
# File 'lib/wamp/client/response.rb', line 88 def self.from_hash(hash) self.new(hash[:error], hash[:args], hash[:kwargs]) end |
.from_message(msg) ⇒ Object
96 97 98 |
# File 'lib/wamp/client/response.rb', line 96 def self.(msg) self.new(msg.error, msg.arguments, msg.argumentskw) end |
Instance Method Details
#to_hash ⇒ Object
92 93 94 |
# File 'lib/wamp/client/response.rb', line 92 def to_hash { error: self.error, args: self.args, kwargs: self.kwargs } end |