123456789_123456789_123456789_123456789_123456789_

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
Instance Chain:
self, CommandData
Inherits: Net::IMAP::CommandData
Defined in: lib/net/imap/command_data.rb

Class Method Summary

CommandData - Inherited

.[]

Alias for CommandData.new.

.new,
.validate

following class definition goes beyond the basic Data.define(:data).

Instance Attribute Summary

CommandData - Inherited

Instance Method Summary

Constructor Details

.newAtom

[ GitHub ]

  
# File 'lib/net/imap/command_data.rb', line 298

def initialize(**)
  super
  validate
end

Instance Method Details

#send_data(imap, tag)

[ GitHub ]

  
# File 'lib/net/imap/command_data.rb', line 312

def send_data(imap, tag)
  imap.__send__(:put_string, data.to_s)
end

#validate

[ GitHub ]

  
# File 'lib/net/imap/command_data.rb', line 303

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