class StructuredReader::JSONReader::TimeReader

Public Instance Methods

maybe_parse(fragment, context) click to toggle source
# File lib/structured_reader.rb, line 200
def maybe_parse(fragment, context)
  begin
    context.accept DateTime.parse(fragment)
  rescue ArgumentError
    context.flunk(fragment, "could not be converted to a DateTime")
  end
end