Sha256: db2c4b3d889825f08adf4db0f12dc098a25a09153e6a137d3046d9a89b488538

Contents?: true

Size: 743 Bytes

Versions: 15

Compression:

Stored size: 743 Bytes

Contents

# encoding: utf-8
module Mail
  module CommonDate # :nodoc:
    
    module InstanceMethods # :doc:
      
      # Returns a date time object of the parsed date
      def date_time
        ::DateTime.parse("#{element.date_string} #{element.time_string}")
      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
      
      # Returns the syntax tree of the Date
      def tree
        @tree ||= element.tree
      end
      
    end
    
    def self.included(receiver) # :nodoc:
      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_date.rb
mail-1.4.2 lib/mail/fields/common/common_date.rb
mail-1.4.1 lib/mail/fields/common/common_date.rb
mail-1.4.0 lib/mail/fields/common/common_date.rb
mail-1.3.5 lib/mail/fields/common/common_date.rb
mail-1.3.4 lib/mail/fields/common/common_date.rb
mail-1.3.3 lib/mail/fields/common/common_date.rb
mail-1.3.2 lib/mail/fields/common/common_date.rb
mail-1.3.1 lib/mail/fields/common/common_date.rb
mail-1.3.0 lib/mail/fields/common/common_date.rb
mail-1.2.9 lib/mail/fields/common/common_date.rb
mail-1.2.8 lib/mail/fields/common/common_date.rb
mail-1.2.6 lib/mail/fields/common/common_date.rb
mail-1.2.5 ./lib/mail/fields/common/common_date.rb
mail-1.2.1 ./lib/mail/fields/common/common_date.rb