Class: MTProto::TL::Contacts
- Inherits:
-
Object
- Object
- MTProto::TL::Contacts
- Defined in:
- lib/mtproto/tl/objects/contacts.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#contacts ⇒ Object
readonly
Returns the value of attribute contacts.
-
#not_modified ⇒ Object
readonly
Returns the value of attribute not_modified.
-
#saved_count ⇒ Object
readonly
Returns the value of attribute saved_count.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(contacts: [], saved_count: 0, users: [], not_modified: false) ⇒ Contacts
constructor
A new instance of Contacts.
- #not_modified? ⇒ Boolean
Constructor Details
#initialize(contacts: [], saved_count: 0, users: [], not_modified: false) ⇒ Contacts
Returns a new instance of Contacts.
14 15 16 17 18 19 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 14 def initialize(contacts: [], saved_count: 0, users: [], not_modified: false) @contacts = contacts @saved_count = saved_count @users = users @not_modified = not_modified end |
Instance Attribute Details
#contacts ⇒ Object (readonly)
Returns the value of attribute contacts.
12 13 14 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 12 def contacts @contacts end |
#not_modified ⇒ Object (readonly)
Returns the value of attribute not_modified.
12 13 14 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 12 def not_modified @not_modified end |
#saved_count ⇒ Object (readonly)
Returns the value of attribute saved_count.
12 13 14 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 12 def saved_count @saved_count end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
12 13 14 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 12 def users @users end |
Class Method Details
.deserialize(data) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 25 def self.deserialize(data) constructor = data[0, 4].unpack1('L<') return new(not_modified: true) if constructor == Constructors::CONTACTS_CONTACTS_NOT_MODIFIED raise UnexpectedConstructorError, constructor unless constructor == Constructors::CONTACTS_CONTACTS offset = 4 contacts, offset = parse_contacts_vector(data, offset) saved_count = data[offset, 4].unpack1('l<') offset += 4 users, = parse_users_vector(data, offset) new(contacts: contacts, saved_count: saved_count, users: users) end |
Instance Method Details
#not_modified? ⇒ Boolean
21 22 23 |
# File 'lib/mtproto/tl/objects/contacts.rb', line 21 def not_modified? @not_modified end |