Class: MTProto::TL::GetFullUser

Inherits:
Object
  • Object
show all
Includes:
Binary
Defined in:
lib/mtproto/tl/objects/get_full_user.rb

Constant Summary collapse

CONSTRUCTOR =
0xb60f5918
INPUT_USER =
0xf21158c6
INPUT_USER_SELF =
0xf7c1b13f

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(user:) ⇒ GetFullUser

user: { id:, access_hash: } or { type: :self }



13
14
15
# File 'lib/mtproto/tl/objects/get_full_user.rb', line 13

def initialize(user:)
  @user = user
end

Instance Method Details

#serializeObject



17
18
19
20
21
22
23
24
25
# File 'lib/mtproto/tl/objects/get_full_user.rb', line 17

def serialize
  result = u32_b(CONSTRUCTOR)
  result += if @user[:type] == :self
              u32_b(INPUT_USER_SELF)
            else
              u32_b(INPUT_USER) + u64_b(@user[:id]) + u64_b(@user[:access_hash] || 0)
            end
  result
end