Class: MTProto::TL::Object
- Inherits:
-
Object
- Object
- MTProto::TL::Object
- Extended by:
- Binary
- Defined in:
- lib/mtproto/tl/object.rb
Instance Attribute Summary collapse
-
#constructor ⇒ Object
readonly
Returns the value of attribute constructor.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(constructor, payload) ⇒ Object
constructor
A new instance of Object.
Methods included from Binary
Constructor Details
#initialize(constructor, payload) ⇒ Object
Returns a new instance of Object.
10 11 12 13 |
# File 'lib/mtproto/tl/object.rb', line 10 def initialize(constructor, payload) @constructor = constructor @payload = payload end |
Instance Attribute Details
#constructor ⇒ Object (readonly)
Returns the value of attribute constructor.
8 9 10 |
# File 'lib/mtproto/tl/object.rb', line 8 def constructor @constructor end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
8 9 10 |
# File 'lib/mtproto/tl/object.rb', line 8 def payload @payload end |
Class Method Details
.deserialize(message) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/mtproto/tl/object.rb', line 15 def self.deserialize() body = .body constructor_id = b_u32(body[0, 4]) constructor = ConstructorNames::NAMES.fetch(constructor_id) payload = body[4..] new(constructor, payload) end |