Class: MTProto::TL::RpcError
- Inherits:
-
Object
- Object
- MTProto::TL::RpcError
- Defined in:
- lib/mtproto/tl/objects/rpc_error.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error_code:, error_message:) ⇒ RpcError
constructor
A new instance of RpcError.
- #to_s ⇒ Object
Constructor Details
#initialize(error_code:, error_message:) ⇒ RpcError
Returns a new instance of RpcError.
21 22 23 24 |
# File 'lib/mtproto/tl/objects/rpc_error.rb', line 21 def initialize(error_code:, error_message:) @error_code = error_code @error_message = end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
6 7 8 |
# File 'lib/mtproto/tl/objects/rpc_error.rb', line 6 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
6 7 8 |
# File 'lib/mtproto/tl/objects/rpc_error.rb', line 6 def @error_message end |
Class Method Details
.deserialize(data) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mtproto/tl/objects/rpc_error.rb', line 8 def self.deserialize(data) offset = 4 error_code = data[offset, 4].unpack1('l<') offset += 4 = data[offset].ord offset += 1 = data[offset, ] new(error_code: error_code, error_message: ) end |
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/mtproto/tl/objects/rpc_error.rb', line 26 def to_s "RPC Error #{@error_code}: #{@error_message}" end |