Class TMail::DeleteFields
In: lib/tmail/net.rb
Parent: Object

Methods

exec   new  

Constants

NOSEND_FIELDS = %w( received bcc )

Attributes

delete_empty_fields  [RW] 
no_send_fields  [R] 

Public Class methods

[Source]

# File lib/tmail/net.rb, line 142
    def initialize( nosend = nil, delempty = true )
      @no_send_fields = nosend || NOSEND_FIELDS.dup
      @delete_empty_fields = delempty
    end

Public Instance methods

[Source]

# File lib/tmail/net.rb, line 150
    def exec( mail )
      @no_send_fields.each do |nm|
        delete nm
      end
      delete_if {|n,v| v.empty? } if @delete_empty_fields
    end

[Validate]