Class: MTProto::TL::Dialogs
- Inherits:
-
Object
- Object
- MTProto::TL::Dialogs
- Defined in:
- lib/mtproto/tl/objects/dialogs.rb
Defined Under Namespace
Classes: Dialog
Instance Attribute Summary collapse
-
#chats ⇒ Object
readonly
Returns the value of attribute chats.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#dialogs ⇒ Object
readonly
Returns the value of attribute dialogs.
-
#message_dates ⇒ Object
readonly
Returns the value of attribute message_dates.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dialogs:, chats:, users:, count: nil, message_dates: {}) ⇒ Dialogs
constructor
A new instance of Dialogs.
- #slice? ⇒ Boolean
Constructor Details
#initialize(dialogs:, chats:, users:, count: nil, message_dates: {}) ⇒ Dialogs
Returns a new instance of Dialogs.
15 16 17 18 19 20 21 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 15 def initialize(dialogs:, chats:, users:, count: nil, message_dates: {}) @dialogs = dialogs @chats = chats @users = users @count = count @message_dates = end |
Instance Attribute Details
#chats ⇒ Object (readonly)
Returns the value of attribute chats.
13 14 15 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 13 def chats @chats end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
13 14 15 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 13 def count @count end |
#dialogs ⇒ Object (readonly)
Returns the value of attribute dialogs.
13 14 15 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 13 def dialogs @dialogs end |
#message_dates ⇒ Object (readonly)
Returns the value of attribute message_dates.
13 14 15 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 13 def @message_dates end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
13 14 15 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 13 def users @users end |
Class Method Details
.deserialize(data) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 27 def self.deserialize(data) constructor = data[0, 4].unpack1('L<') unless [Constructors::MESSAGES_DIALOGS, Constructors::MESSAGES_DIALOGS_SLICE].include?(constructor) raise UnexpectedConstructorError, constructor end offset = 4 count = nil if constructor == Constructors::MESSAGES_DIALOGS_SLICE count = data[offset, 4].unpack1('L<') offset += 4 end dialogs, offset = parse_dialogs_vector(data, offset) , offset = (data, offset) chats, offset = Peers.chats_at(data, offset) users, = Peers.users_at(data, offset) new(dialogs: dialogs, chats: chats, users: users, count: count, message_dates: ) end |
Instance Method Details
#slice? ⇒ Boolean
23 24 25 |
# File 'lib/mtproto/tl/objects/dialogs.rb', line 23 def slice? !@count.nil? end |