Class: MTProto::TL::HelpConfig
- Inherits:
-
Object
- Object
- MTProto::TL::HelpConfig
- Defined in:
- lib/mtproto/tl/objects/help_config.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#dc_options ⇒ Object
readonly
Returns the value of attribute dc_options.
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#test_mode ⇒ Object
readonly
Returns the value of attribute test_mode.
-
#this_dc ⇒ Object
readonly
Returns the value of attribute this_dc.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flags:, date:, expires:, test_mode:, this_dc:, dc_options:) ⇒ HelpConfig
constructor
A new instance of HelpConfig.
Constructor Details
#initialize(flags:, date:, expires:, test_mode:, this_dc:, dc_options:) ⇒ HelpConfig
Returns a new instance of HelpConfig.
8 9 10 11 12 13 14 15 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 8 def initialize(flags:, date:, expires:, test_mode:, this_dc:, dc_options:) @flags = flags @date = date @expires = expires @test_mode = test_mode @this_dc = this_dc @dc_options = end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def date @date end |
#dc_options ⇒ Object (readonly)
Returns the value of attribute dc_options.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def @dc_options end |
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def expires @expires end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def flags @flags end |
#test_mode ⇒ Object (readonly)
Returns the value of attribute test_mode.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def test_mode @test_mode end |
#this_dc ⇒ Object (readonly)
Returns the value of attribute this_dc.
6 7 8 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 6 def this_dc @this_dc end |
Class Method Details
.deserialize(data) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mtproto/tl/objects/help_config.rb', line 17 def self.deserialize(data) constructor = data[0, 4].unpack1('L<') unless [Constructors::CONFIG, Constructors::GZIP_PACKED].include?(constructor) raise UnexpectedConstructorError, constructor end offset = 4 flags = data[offset, 4].unpack1('L<') offset += 4 date = data[offset, 4].unpack1('L<') offset += 4 expires = data[offset, 4].unpack1('L<') offset += 4 test_mode = data[offset, 4].unpack1('L<') == Constructors::BOOL_TRUE offset += 4 this_dc = data[offset, 4].unpack1('L<') offset += 4 offset += 4 # vector constructor dc_count = data[offset, 4].unpack1('L<') offset += 4 = [] dc_count.times do dc_option, offset = parse_dc_option(data, offset) << dc_option end new( flags: flags, date: date, expires: expires, test_mode: test_mode, this_dc: this_dc, dc_options: ) end |