Class: ActiveRpc::Error
- Inherits:
-
Object
- Object
- ActiveRpc::Error
- Defined in:
- lib/active_rpc/errors.rb
Direct Known Subclasses
ActiveRpc::Errors::ArgumentError, ActiveRpc::Errors::ClientError, ActiveRpc::Errors::InternalError, ActiveRpc::Errors::NoMethodError, ActiveRpc::Errors::OperationFailure, ActiveRpc::Errors::ParseError, ActiveRpc::Errors::ServerError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
Returns the value of attribute data.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code:, data: nil, message: nil) ⇒ Error
constructor
A new instance of Error.
- #to_hash ⇒ Object
Constructor Details
#initialize(code:, data: nil, message: nil) ⇒ Error
Returns a new instance of Error.
19 20 21 22 23 |
# File 'lib/active_rpc/errors.rb', line 19 def initialize(code:, data: nil, message: nil) @message = @code = code @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
18 19 20 |
# File 'lib/active_rpc/errors.rb', line 18 def code @code end |
#data ⇒ Object
Returns the value of attribute data.
17 18 19 |
# File 'lib/active_rpc/errors.rb', line 17 def data @data end |
#message ⇒ Object
Returns the value of attribute message.
17 18 19 |
# File 'lib/active_rpc/errors.rb', line 17 def @message end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/active_rpc/errors.rb', line 25 def to_hash { 'code' => code, 'data' => data, 'message' => }.compact end |