Class: MTProto::TL::Update
- Inherits:
-
Object
- Object
- MTProto::TL::Update
- Defined in:
- lib/mtproto/tl/objects/update.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, text: nil) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(type, text: nil) ⇒ Update
Returns a new instance of Update.
8 9 10 11 |
# File 'lib/mtproto/tl/objects/update.rb', line 8 def initialize(type, text: nil) @type = type @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/mtproto/tl/objects/update.rb', line 6 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/mtproto/tl/objects/update.rb', line 6 def type @type end |
Class Method Details
.deserialize(bytes) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mtproto/tl/objects/update.rb', line 13 def self.deserialize(bytes) constructor_id = bytes[0, 4].unpack1('L<') type = type_name(constructor_id) case constructor_id when Constructors::UPDATE_NEW_MESSAGE text = (bytes) new(type, text: text) else new(type) end end |