Module: Spine::Transform::Syntax::Timestamp

Included in:
Mapping
Defined in:
lib/spine/transform/syntax/timestamp.rb

Instance Method Summary collapse

Instance Method Details

#timestamp(key, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/spine/transform/syntax/timestamp.rb', line 5

def timestamp(key, options = {})
  register(
    key,
    intercept(key, options) { |value|
      value.is_a?(DateTime) ? value : DateTime.iso8601(value.to_s)
    }
  )
end