Class: MTProto::TL::UpdateShortMessage
- Inherits:
-
Object
- Object
- MTProto::TL::UpdateShortMessage
- Defined in:
- lib/mtproto/tl/objects/update_short_message.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pts ⇒ Object
readonly
Returns the value of attribute pts.
-
#pts_count ⇒ Object
readonly
Returns the value of attribute pts_count.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flags:, id:, user_id:, text:, pts:, pts_count:, date:) ⇒ UpdateShortMessage
constructor
A new instance of UpdateShortMessage.
- #mentioned? ⇒ Boolean
- #out? ⇒ Boolean
Constructor Details
#initialize(flags:, id:, user_id:, text:, pts:, pts_count:, date:) ⇒ UpdateShortMessage
Returns a new instance of UpdateShortMessage.
8 9 10 11 12 13 14 15 16 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 8 def initialize(flags:, id:, user_id:, text:, pts:, pts_count:, date:) @flags = flags @id = id @user_id = user_id @text = text @pts = pts @pts_count = pts_count @date = date end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def date @date end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def flags @flags end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def id @id end |
#pts ⇒ Object (readonly)
Returns the value of attribute pts.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def pts @pts end |
#pts_count ⇒ Object (readonly)
Returns the value of attribute pts_count.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def pts_count @pts_count end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def text @text end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
6 7 8 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 6 def user_id @user_id end |
Class Method Details
.deserialize(bytes) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 26 def self.deserialize(bytes) offset = 4 # skip constructor flags = bytes[offset, 4].unpack1('L<') offset += 4 id = bytes[offset, 4].unpack1('l<') offset += 4 user_id = bytes[offset, 8].unpack1('q<') offset += 8 text, offset = read_tl_string(bytes, offset) 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, user_id: user_id, text: text, pts: pts, pts_count: pts_count, date: date) end |
Instance Method Details
#mentioned? ⇒ Boolean
22 23 24 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 22 def mentioned? flags & (1 << 4) != 0 end |
#out? ⇒ Boolean
18 19 20 |
# File 'lib/mtproto/tl/objects/update_short_message.rb', line 18 def out? flags & (1 << 1) != 0 end |