Class: MTProto::Type::RpcError
- Inherits:
-
Object
- Object
- MTProto::Type::RpcError
- Defined in:
- lib/mtproto/type/rpc_error.rb
Constant Summary collapse
- CONSTRUCTOR =
0x2144ca19
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.
24 25 26 27 |
# File 'lib/mtproto/type/rpc_error.rb', line 24 def initialize(error_code:, error_message:) @error_code = error_code = end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
8 9 10 |
# File 'lib/mtproto/type/rpc_error.rb', line 8 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
8 9 10 |
# File 'lib/mtproto/type/rpc_error.rb', line 8 def end |
Class Method Details
.deserialize(data) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mtproto/type/rpc_error.rb', line 10 def self.deserialize(data) offset = 4 error_code = data[offset, 4].unpack1('l<') offset += 4 = data[offset].ord offset += 1 = data[offset, ] offset += new(error_code: error_code, error_message: ) end |
Instance Method Details
#to_s ⇒ Object
29 30 31 |
# File 'lib/mtproto/type/rpc_error.rb', line 29 def to_s "RPC Error #{@error_code}: #{@error_message}" end |