Class: MTProto::TL::PQInnerData
- Inherits:
-
Object
- Object
- MTProto::TL::PQInnerData
- Includes:
- Binary
- Defined in:
- lib/mtproto/tl/objects/pq_inner_data.rb
Instance Attribute Summary collapse
-
#dc ⇒ Object
readonly
Returns the value of attribute dc.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#new_nonce ⇒ Object
readonly
Returns the value of attribute new_nonce.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#p ⇒ Object
readonly
Returns the value of attribute p.
-
#pq ⇒ Object
readonly
Returns the value of attribute pq.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#server_nonce ⇒ Object
readonly
Returns the value of attribute server_nonce.
Instance Method Summary collapse
-
#initialize(pq:, p:, q:, nonce:, server_nonce:, new_nonce:, dc:, expires_in: nil) ⇒ PQInnerData
constructor
A new instance of PQInnerData.
- #serialize ⇒ Object
Methods included from Binary
#b_u32, #b_u64, #u32_b, #u64_b
Constructor Details
#initialize(pq:, p:, q:, nonce:, server_nonce:, new_nonce:, dc:, expires_in: nil) ⇒ PQInnerData
Returns a new instance of PQInnerData.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 10 def initialize(pq:, p:, q:, nonce:, server_nonce:, new_nonce:, dc:, expires_in: nil) @pq = pq @p = p @q = q @nonce = nonce @server_nonce = server_nonce @new_nonce = new_nonce @dc = dc @expires_in = expires_in end |
Instance Attribute Details
#dc ⇒ Object (readonly)
Returns the value of attribute dc.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def dc @dc end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def expires_in @expires_in end |
#new_nonce ⇒ Object (readonly)
Returns the value of attribute new_nonce.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def new_nonce @new_nonce end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def nonce @nonce end |
#p ⇒ Object (readonly)
Returns the value of attribute p.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def p @p end |
#pq ⇒ Object (readonly)
Returns the value of attribute pq.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def pq @pq end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def q @q end |
#server_nonce ⇒ Object (readonly)
Returns the value of attribute server_nonce.
8 9 10 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 8 def server_nonce @server_nonce end |
Instance Method Details
#serialize ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mtproto/tl/objects/pq_inner_data.rb', line 21 def serialize constructor = @expires_in ? Constructors::PQ_INNER_DATA_TEMP_DC : Constructors::PQ_INNER_DATA_DC result = u32_b(constructor) result += serialize_tl_bytes(integer_to_bytes(@pq)) result += serialize_tl_bytes(integer_to_bytes(@p)) result += serialize_tl_bytes(integer_to_bytes(@q)) result += @nonce.bytes result += @server_nonce.bytes result += @new_nonce.bytes result += u32_b(@expires_in) if @expires_in result += u32_b(@dc) result end |