Module: Necromancer::DateTimeConverters

Defined in:
lib/necromancer/converters/date_time.rb

Overview

Container for Date converter classes

Defined Under Namespace

Classes: StringToDateConverter, StringToDateTimeConverter, StringToTimeConverter

Class Method Summary collapse

Class Method Details

.load(conversions) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/necromancer/converters/date_time.rb', line 65

def self.load(conversions)
  [
    StringToDateConverter.new(:string, :date),
    NullConverter.new(:date, :date),
    StringToDateTimeConverter.new(:string, :datetime),
    NullConverter.new(:datetime, :datetime),
    StringToTimeConverter.new(:string, :time),
    NullConverter.new(:time, :time)
  ].each do |converter|
    conversions.register converter
  end
end