Sha256: 967e72a20cff95cc6eac906abfb20cd0e912034e0b53198dd954f4906fe5b67f

Contents?: true

Size: 796 Bytes

Versions: 158

Compression:

Stored size: 796 Bytes

Contents

# encoding: utf-8
# 
# resent-date     =       "Resent-Date:" date-time CRLF
require 'mail/fields/common/common_date'

module Mail
  class ResentDateField < StructuredField
    
    include Mail::CommonDate
    
    FIELD_NAME = 'resent-date'
    CAPITALIZED_FIELD = 'Resent-Date'
    
    def initialize(value = nil, charset = 'utf-8')
      self.charset = charset
      if value.blank?
        value = ::DateTime.now.strftime('%a, %d %b %Y %H:%M:%S %z')
      else
        value = strip_field(FIELD_NAME, value)
        value = ::DateTime.parse(value.to_s).strftime('%a, %d %b %Y %H:%M:%S %z')
      end
      super(CAPITALIZED_FIELD, value, charset)
      self
    end
    
    def encoded
      do_encode(CAPITALIZED_FIELD)
    end
    
    def decoded
      do_decode
    end
    
  end
end

Version data entries

158 entries across 145 versions & 21 rubygems

Version Path
mail-2.5.5 lib/mail/fields/resent_date_field.rb
mail-2.5.5.rc1 lib/mail/fields/resent_date_field.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/resent_date_field.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/resent_date_field.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/resent_date_field.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/resent_date_field.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/resent_date_field.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/fields/resent_date_field.rb
mail-2.6.3 lib/mail/fields/resent_date_field.rb
mail-portertech-2.6.2.edge lib/mail/fields/resent_date_field.rb
mail-2.6.1 lib/mail/fields/resent_date_field.rb