Sha256: 06fa45bf81b51c99648227bc992bb231659dab3a38d621a7f608e93230d6beed

Contents?: true

Size: 625 Bytes

Versions: 14

Compression:

Stored size: 625 Bytes

Contents

# encoding: utf-8
module Mail
  module CommonDate # :nodoc:
    # Returns a date time object of the parsed date
    def date_time
      ::DateTime.parse("#{element.date_string} #{element.time_string}")
    end

    def default
      date_time
    end
    
    def parse(val = value)
      unless val.blank?
        @element = Mail::DateTimeElement.new(val)
      else
        nil
      end
    end

    private
    
    def do_encode(field_name)
      "#{field_name}: #{value}\r\n"
    end
    
    def do_decode
      "#{value}"
    end

    def element
      @element ||= Mail::DateTimeElement.new(value)
    end
  end
end

Version data entries

14 entries across 13 versions & 7 rubygems

Version Path
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/common/common_date.rb
mail-2.6.3 lib/mail/fields/common/common_date.rb
mail-portertech-2.6.2.edge lib/mail/fields/common/common_date.rb
mail-2.6.1 lib/mail/fields/common/common_date.rb
mail-2.6.0 lib/mail/fields/common/common_date.rb