Class: Mida::DataType::ISO8601Date

Inherits:
Generic
  • Object
show all
Defined in:
lib/mida/datatype/iso8601date.rb

Overview

ISO 8601 Date data type Provides access to DateTime methods

Instance Method Summary collapse

Methods inherited from Generic

#==, #method_missing, parse, #to_yaml

Constructor Details

#initialize(value) ⇒ ISO8601Date

Raises ArgumentError if value not valid



12
13
14
15
16
# File 'lib/mida/datatype/iso8601date.rb', line 12

def initialize(value)
  @parsedValue = ::DateTime.iso8601(value)
rescue => e
  raise ArgumentError, e
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mida::DataType::Generic

Instance Method Details

#to_sObject



18
19
20
# File 'lib/mida/datatype/iso8601date.rb', line 18

def to_s
  @parsedValue.rfc822
end