Parent

Methods

SafeYAML::Transform::ToTime

Constants

MATCHER

There isn't a missing '$' there; YAML itself seems to ignore everything at the end of a string that otherwise resembles a time.

Public Instance Methods

transform?(value) click to toggle source
# File lib/safe_yaml/transform/to_time.rb, line 8
def transform?(value)
  return false unless MATCHER.match(value)
  datetime = DateTime.parse(value) rescue nil
  if datetime.respond_to?(:to_time)
    return true, datetime.to_time
  end
  false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.