Class: Net::IMAP::AppendUIDData
- Inherits:
-
Object
- Object
- Net::IMAP::AppendUIDData
- Defined in:
- lib/net/imap/uidplus_data.rb
Overview
NOTE: AppendUIDData will replace UIDPlusData for
APPENDUIDin the0.6.0release. To use AppendUIDData before0.6.0, set Config#parser_use_deprecated_uidplus_data tofalse.
AppendUIDData represents the ResponseCode#data that accompanies the APPENDUID response code.
A server that supports UIDPLUS (or IMAP4rev2) should send AppendUIDData inside every TaggedResponse returned by the append command—unless the target mailbox reports UIDNOTSTICKY.
Required capability
Requires either UIDPLUS [RFC4315] or IMAP4rev2 capability.
Instance Method Summary collapse
-
#initialize(uidvalidity:, assigned_uids:) ⇒ AppendUIDData
constructor
A new instance of AppendUIDData.
-
#size ⇒ Object
Returns the number of messages that have been appended.
Constructor Details
#initialize(uidvalidity:, assigned_uids:) ⇒ AppendUIDData
Returns a new instance of AppendUIDData.
84 85 86 87 88 89 90 91 92 |
# File 'lib/net/imap/uidplus_data.rb', line 84 def initialize(uidvalidity:, assigned_uids:) uidvalidity = Integer(uidvalidity) assigned_uids = SequenceSet[assigned_uids] NumValidator.ensure_nz_number(uidvalidity) if assigned_uids.include_star? raise DataFormatError, "uid-set cannot contain '*'" end super end |
Instance Method Details
#size ⇒ Object
Returns the number of messages that have been appended.
106 107 108 |
# File 'lib/net/imap/uidplus_data.rb', line 106 def size assigned_uids.count_with_duplicates end |