Class: MTProto::TL::InitConnection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(api_id:, device_model:, system_version:, app_version:, system_lang_code:, lang_pack:, lang_code:, query:) ⇒ InitConnection

Returns a new instance of InitConnection.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mtproto/tl/objects/init_connection.rb', line 11

def initialize(api_id:, device_model:, system_version:, app_version:,
               system_lang_code:, lang_pack:, lang_code:, query:)
  @api_id = api_id
  @device_model = device_model
  @system_version = system_version
  @app_version = app_version
  @system_lang_code = system_lang_code
  @lang_pack = lang_pack
  @lang_code = lang_code
  @query = query
end

Instance Attribute Details

#api_idObject (readonly)

Returns the value of attribute api_id.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def api_id
  @api_id
end

#app_versionObject (readonly)

Returns the value of attribute app_version.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def app_version
  @app_version
end

#device_modelObject (readonly)

Returns the value of attribute device_model.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def device_model
  @device_model
end

#lang_codeObject (readonly)

Returns the value of attribute lang_code.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def lang_code
  @lang_code
end

#lang_packObject (readonly)

Returns the value of attribute lang_pack.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def lang_pack
  @lang_pack
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def query
  @query
end

#system_lang_codeObject (readonly)

Returns the value of attribute system_lang_code.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def system_lang_code
  @system_lang_code
end

#system_versionObject (readonly)

Returns the value of attribute system_version.



8
9
10
# File 'lib/mtproto/tl/objects/init_connection.rb', line 8

def system_version
  @system_version
end

Instance Method Details

#serializeObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/mtproto/tl/objects/init_connection.rb', line 23

def serialize
  flags = 0

  result = u32_b(Constructors::INIT_CONNECTION)
  result += u32_b(flags)
  result += u32_b(@api_id)
  result += serialize_tl_string(@device_model)
  result += serialize_tl_string(@system_version)
  result += serialize_tl_string(@app_version)
  result += serialize_tl_string(@system_lang_code)
  result += serialize_tl_string(@lang_pack)
  result += serialize_tl_string(@lang_code)
  result + @query.serialize
end