Class: Net::IMAP::Atom
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
CommandData,
Data
|
|
|
Instance Chain:
self,
CommandData,
Data
|
|
| Inherits: |
Net::IMAP::CommandData
|
| Defined in: | lib/net/imap/command_data.rb |
Overview
Please note that ATOM-CHAR and atom are not the same as ASTRING-char
and the atom form of astring. astring allows ], but atom
does not.
Generic string arguments in ::Net::IMAP use astring, so they will send as
atoms even if they contain ].
This class is used by:
- to validate generic symbol arguments, as the superclass of
Flag - to validate #enable #capabilities
- to validate #store (and #uid_store)
attr
Class Method Summary
Instance Attribute Summary
CommandData - Inherited
Instance Method Summary
Constructor Details
.new ⇒ Atom
# File 'lib/net/imap/command_data.rb', line 302
def initialize(**) super validate end
Instance Method Details
#send_data(imap, tag)
[ GitHub ]# File 'lib/net/imap/command_data.rb', line 316
def send_data(imap, tag) imap.__send__(:put_string, data.to_s) end
#validate
[ GitHub ]# File 'lib/net/imap/command_data.rb', line 307
def validate data.to_s.ascii_only? \ or raise DataFormatError, "#{self.class} must be ASCII only" data.match?(ResponseParser::Patterns::ATOM_SPECIALS) \ and raise DataFormatError, "#{self.class} must not contain atom-specials" data.empty? \ and raise DataFormatError, "#{self.class} must not be empty" end