Class: MTProto::TL::EditAccessSettings
- Inherits:
-
Object
- Object
- MTProto::TL::EditAccessSettings
- Includes:
- Binary
- Defined in:
- lib/mtproto/tl/objects/edit_access_settings.rb
Constant Summary collapse
- CONSTRUCTOR =
0x31813cd8- INPUT_USER =
0xf21158c6- INPUT_USER_SELF =
0xf7c1b13f
Instance Method Summary collapse
-
#initialize(bot:, restricted: false, add_users: []) ⇒ EditAccessSettings
constructor
bot / add_users entries: { id:, access_hash: } or { type: :self }.
- #serialize ⇒ Object
Methods included from Binary
#b_u32, #b_u64, #u32_b, #u64_b
Constructor Details
#initialize(bot:, restricted: false, add_users: []) ⇒ EditAccessSettings
bot / add_users entries: { id:, access_hash: } or { type: :self }
13 14 15 16 17 |
# File 'lib/mtproto/tl/objects/edit_access_settings.rb', line 13 def initialize(bot:, restricted: false, add_users: []) @bot = bot @restricted = restricted @add_users = add_users end |
Instance Method Details
#serialize ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mtproto/tl/objects/edit_access_settings.rb', line 19 def serialize flags = 0 flags |= (1 << 0) if @restricted flags |= (1 << 1) unless @add_users.empty? result = u32_b(CONSTRUCTOR) result += u32_b(flags) result += serialize_input_user(@bot) unless @add_users.empty? result += u32_b(Constructors::VECTOR) result += u32_b(@add_users.size) @add_users.each { |u| result += serialize_input_user(u) } end result end |