Method: EventMachine::IMAP::Formatter.format

Defined in:
lib/em-imap/formatter.rb

.format(data, &block) ⇒ Object

Format the data to be sent into strings and literals, and call the block for each token to be sent.

NOTE: The block is responsible for handling any network-level concerns, such as sending literals only with permission.

Parameters:

  • data

    The data to format,

  • &block

    The callback, which will be called with a number of strings and EM::IMAP::Formatter::Literal instances.



18
19
20
# File 'lib/em-imap/formatter.rb', line 18

def self.format(data, &block)
  new(&block).send_data(data)
end