Class: MTProto::TL::UpdateShortSentMessage

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flags:, id:, pts:, pts_count:, date:) ⇒ UpdateShortSentMessage

Returns a new instance of UpdateShortSentMessage.



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

def initialize(flags:, id:, pts:, pts_count:, date:)
  @flags = flags
  @id = id
  @pts = pts
  @pts_count = pts_count
  @date = date
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



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

def date
  @date
end

#flagsObject (readonly)

Returns the value of attribute flags.



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

def flags
  @flags
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#ptsObject (readonly)

Returns the value of attribute pts.



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

def pts
  @pts
end

#pts_countObject (readonly)

Returns the value of attribute pts_count.



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

def pts_count
  @pts_count
end

Class Method Details

.deserialize(bytes) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/mtproto/tl/objects/update_short_sent_message.rb', line 20

def self.deserialize(bytes)
  offset = 4 # skip constructor
  flags = bytes[offset, 4].unpack1('L<')
  offset += 4
  id = bytes[offset, 4].unpack1('l<')
  offset += 4
  pts = bytes[offset, 4].unpack1('l<')
  offset += 4
  pts_count = bytes[offset, 4].unpack1('l<')
  offset += 4
  date = bytes[offset, 4].unpack1('l<')

  new(flags: flags, id: id, pts: pts, pts_count: pts_count, date: date)
end

Instance Method Details

#out?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/mtproto/tl/objects/update_short_sent_message.rb', line 16

def out?
  flags & (1 << 1) != 0
end