Sha256: fd15c3043afb8266be94c8bf3ad6c578354981a554abcf6fc7071864cc7f9255

Contents?: true

Size: 860 Bytes

Versions: 15

Compression:

Stored size: 860 Bytes

Contents

# encoding: utf-8
module Mail
  module CommonMessageId # :nodoc:
    
    module ClassMethods # :nodoc:
      
    end
    
    module InstanceMethods # :doc:
      
      def tree
        @tree ||= element.tree
      end
      
      def element
        @element ||= Mail::MessageIdsElement.new(value)
      end
      
      def message_id
        element.message_id
      end
      
      def message_ids
        element.message_ids
      end
      
      private
      
      def do_encode(field_name)
        %Q{#{field_name}: #{message_ids.map { |m| "<#{m}>" }.join(', ')}\r\n}
      end
      
      def do_decode
        "#{message_ids.map { |m| "<#{m}>" }.join(', ')}"
      end
      
    end
    
    def self.included(receiver) # :nodoc:
      receiver.extend         ClassMethods
      receiver.send :include, InstanceMethods
    end
    
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mail-1.4.3 lib/mail/fields/common/common_message_id.rb
mail-1.4.2 lib/mail/fields/common/common_message_id.rb
mail-1.4.1 lib/mail/fields/common/common_message_id.rb
mail-1.4.0 lib/mail/fields/common/common_message_id.rb
mail-1.3.5 lib/mail/fields/common/common_message_id.rb
mail-1.3.4 lib/mail/fields/common/common_message_id.rb
mail-1.3.3 lib/mail/fields/common/common_message_id.rb
mail-1.3.2 lib/mail/fields/common/common_message_id.rb
mail-1.3.1 lib/mail/fields/common/common_message_id.rb
mail-1.3.0 lib/mail/fields/common/common_message_id.rb
mail-1.2.9 lib/mail/fields/common/common_message_id.rb
mail-1.2.8 lib/mail/fields/common/common_message_id.rb
mail-1.2.6 lib/mail/fields/common/common_message_id.rb
mail-1.2.5 ./lib/mail/fields/common/common_message_id.rb
mail-1.2.1 ./lib/mail/fields/common/common_message_id.rb