Class: MTProto::TL::SendCode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(phone_number:, api_id:, api_hash:) ⇒ SendCode

Returns a new instance of SendCode.



10
11
12
13
14
# File 'lib/mtproto/tl/objects/send_code.rb', line 10

def initialize(phone_number:, api_id:, api_hash:)
  @phone_number = phone_number
  @api_id = api_id
  @api_hash = api_hash
end

Instance Attribute Details

#api_hashObject (readonly)

Returns the value of attribute api_hash.



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

def api_hash
  @api_hash
end

#api_idObject (readonly)

Returns the value of attribute api_id.



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

def api_id
  @api_id
end

#phone_numberObject (readonly)

Returns the value of attribute phone_number.



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

def phone_number
  @phone_number
end

Instance Method Details

#serializeObject



16
17
18
19
20
21
22
# File 'lib/mtproto/tl/objects/send_code.rb', line 16

def serialize
  u32_b(Constructors::AUTH_SEND_CODE) +
    serialize_tl_string(@phone_number) +
    u32_b(@api_id) +
    serialize_tl_string(@api_hash) +
    code_settings
end