Sha256: a6b33dab996733cc02ebb4189ed0730ad4668eb8fb31699cde8b4f05002dfad1
Contents?: true
Size: 444 Bytes
Versions: 4
Compression:
Stored size: 444 Bytes
Contents
require 'mida/datatype/generic' require 'date' module Mida module DataType # ISO 8601 Date data type # Provides access to DateTime methods class ISO8601Date < Generic # Raises +ArgumentError+ if value not valid def initialize(value) @parsedValue = ::DateTime.iso8601(value) rescue => e raise ArgumentError, e end def to_s @parsedValue.rfc822 end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
mida-0.3.9 | lib/mida/datatype/iso8601date.rb |
mida-0.3.8 | lib/mida/datatype/iso8601date.rb |
mida-0.3.7 | lib/mida/datatype/iso8601date.rb |
mida-0.3.6 | lib/mida/datatype/iso8601date.rb |