lib/mime/message_content.rb
# Returns the MIME-compliant representation of the specified value.
#
Returns the MIME-compliant representation of the specified value.
Returns the MIME - compliant representation of the specified value .
def format(value)
        result = ""
        if value.is_a?(Time) || value.is_a?(Date)
          result = value.strftime(DATE_TIME_FORMAT)
        elsif value.is_a?(Mailbox)
          result = value.to_s(true)
        elsif value.is_a?(Array)
          value.each do |element|
            result << ", " unless result.empty?
            if element.is_a?(Mailbox)
              result << element.to_s(true)
            else
              result << element.to_s
            end
          end
        else
          result = value.to_s
          result = encoded_word(result) unless result.ascii_only?
        end
        result
      end
def format ( value ) result = "" if value . is_a? ( Time ) || value . is_a? ( Date ) result = value . strftime ( DATE_TIME_FORMAT ) elsif value . is_a? ( Mailbox ) result = value . to_s ( true ) elsif value . is_a? ( Array ) value . each do | element | result << ", " unless result . empty? if element . is_a? ( Mailbox ) result << element . to_s ( true ) else result << element . to_s end end else result = value . to_s result = encoded_word ( result ) unless result . ascii_only? end result end
Returns the MIME-compliant representation of the specified value.
Returns the MIME - compliant representation of the specified value .
# time, date, or date-time # mailbox # e.g. mailbox list # any other object
value