Class: MTProto::TL::UpdatesState

Inherits:
Object
  • Object
show all
Defined in:
lib/mtproto/tl/objects/updates_state.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pts:, qts:, date:, seq:, unread_count:) ⇒ UpdatesState

Returns a new instance of UpdatesState.



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

def initialize(pts:, qts:, date:, seq:, unread_count:)
  @pts = pts
  @qts = qts
  @date = date
  @seq = seq
  @unread_count = unread_count
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



6
7
8
# File 'lib/mtproto/tl/objects/updates_state.rb', line 6

def date
  @date
end

#ptsObject

Returns the value of attribute pts.



6
7
8
# File 'lib/mtproto/tl/objects/updates_state.rb', line 6

def pts
  @pts
end

#qtsObject

Returns the value of attribute qts.



6
7
8
# File 'lib/mtproto/tl/objects/updates_state.rb', line 6

def qts
  @qts
end

#seqObject

Returns the value of attribute seq.



6
7
8
# File 'lib/mtproto/tl/objects/updates_state.rb', line 6

def seq
  @seq
end

#unread_countObject

Returns the value of attribute unread_count.



6
7
8
# File 'lib/mtproto/tl/objects/updates_state.rb', line 6

def unread_count
  @unread_count
end

Class Method Details

.deserialize(data) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/mtproto/tl/objects/updates_state.rb', line 16

def self.deserialize(data)
  constructor = data[0, 4].unpack1('L<')
  raise UnexpectedConstructorError, constructor unless constructor == Constructors::UPDATES_STATE

  offset = 4
  pts = data[offset, 4].unpack1('L<')
  offset += 4
  qts = data[offset, 4].unpack1('L<')
  offset += 4
  date = data[offset, 4].unpack1('L<')
  offset += 4
  seq = data[offset, 4].unpack1('L<')
  offset += 4
  unread_count = data[offset, 4].unpack1('L<')

  new(pts: pts, qts: qts, date: date, seq: seq, unread_count: unread_count)
end